File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 198
198
199
199
"""
200
200
stat(file)
201
+ stat(joinpath...)
201
202
202
203
Return a structure whose fields contain information about the file.
203
204
The fields of the structure are:
@@ -218,16 +219,19 @@ The fields of the structure are:
218
219
| mtime | `Float64` | Unix timestamp of when the file was last modified |
219
220
| ctime | `Float64` | Unix timestamp of when the file's metadata was changed |
220
221
"""
222
+ stat (path) = (path2 = joinpath (path); path2 isa typeof (path) ? error (" stat not implemented for $(typeof (path)) " ) : stat (path2))
221
223
stat (path... ) = stat (joinpath (path... ))
222
224
223
225
"""
224
226
lstat(file)
227
+ lstat(joinpath...)
225
228
226
229
Like [`stat`](@ref), but for symbolic links gets the info for the link
227
230
itself rather than the file it refers to.
228
231
This function must be called on a file path rather than a file object or a file
229
232
descriptor.
230
233
"""
234
+ lstat (path) = (path2 = joinpath (path); path2 isa typeof (path) ? error (" lstat not implemented for $(typeof (path)) " ) : lstat (path2))
231
235
lstat (path... ) = lstat (joinpath (path... ))
232
236
233
237
# some convenience functions
Original file line number Diff line number Diff line change @@ -1753,8 +1753,18 @@ end
1753
1753
@test s. blocks isa Int64
1754
1754
@test s. mtime isa Float64
1755
1755
@test s. ctime isa Float64
1756
+
1757
+ @test s === stat ((f,))
1758
+ @test s === lstat ((f,))
1759
+ @test s === stat (" ." , f)
1760
+ @test s === lstat (" ." , f)
1756
1761
end
1757
1762
1763
+ mutable struct URI50890; f:: String ; end
1764
+ Base. joinpath (x:: URI50890 ) = URI50890 (x. f)
1765
+ @test_throws " stat not implemented" stat (URI50890 (" ." ))
1766
+ @test_throws " lstat not implemented" lstat (URI50890 (" ." ))
1767
+
1758
1768
@testset " StatStruct show's extended details" begin
1759
1769
f, io = mktemp ()
1760
1770
s = stat (f)
You can’t perform that action at this time.
0 commit comments