Skip to content

Commit db92d21

Browse files
rename and make private
1 parent 8f997dd commit db92d21

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed

NEWS.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ New library functions
3333
---------------------
3434

3535
* `logrange(start, stop; length)` makes a range of constant ratio, instead of constant step ([#39071])
36-
* `readdirx` for returning directory contents along with the type of the entries in a vector of new `DirEntry`
37-
objects ([#53377])
3836

3937
New library features
4038
--------------------

base/exports.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,6 @@ export
866866
readbytes!,
867867
readchomp,
868868
readdir,
869-
readdirx,
870869
readline,
871870
readlines,
872871
readuntil,

base/file.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export
1919
rename,
2020
readlink,
2121
readdir,
22-
readdirx,
2322
rm,
2423
samefile,
2524
sendfile,
@@ -979,13 +978,13 @@ ischardev(obj::DirEntry) = (isunknown(obj) || islink(obj)) ? ischardev(obj.path
979978
isblockdev(obj::DirEntry) = (isunknown(obj) || islink(obj)) ? isblockdev(obj.path) : obj.rawtype == UV_DIRENT_BLOCK
980979

981980
"""
982-
readdirx(dir::AbstractString=pwd(); sort::Bool = true) -> Vector{DirEntry}
981+
_readdirx(dir::AbstractString=pwd(); sort::Bool = true) -> Vector{DirEntry}
983982
984983
Return a vector of [`DirEntry`](@ref) objects representing the contents of the directory `dir`,
985984
or the current working directory if not given. If `sort` is true, the returned vector is
986985
sorted by name.
987986
988-
Unlike [`readdir`](@ref), `readdirx` returns [`DirEntry`](@ref) objects, which contain the name of the
987+
Unlike [`readdir`](@ref), `_readdirx` returns [`DirEntry`](@ref) objects, which contain the name of the
989988
file, the directory it is in, and the type of the file which is determined during the
990989
directory scan. This means that calls to [`isfile`](@ref), [`isdir`](@ref), [`islink`](@ref), [`isfifo`](@ref),
991990
[`issocket`](@ref), [`ischardev`](@ref), and [`isblockdev`](@ref) can be made on the
@@ -994,12 +993,12 @@ cannot be determined without a stat call. In these cases the `rawtype` field of
994993
object will be 0 (`UV_DIRENT_UNKNOWN`) and [`isfile`](@ref) etc. will fall back to a `stat` call.
995994
996995
```julia
997-
for obj in readdirx()
996+
for obj in _readdirx()
998997
isfile(obj) && println("$(obj.name) is a file with path $(obj.path)")
999998
end
1000999
```
10011000
"""
1002-
readdirx(dir::AbstractString=pwd(); sort::Bool=true) = _readdir(dir; return_objects=true, sort)::Vector{DirEntry}
1001+
_readdirx(dir::AbstractString=pwd(); sort::Bool=true) = _readdir(dir; return_objects=true, sort)::Vector{DirEntry}
10031002

10041003
function _readdir(dir::AbstractString; return_objects::Bool=false, join::Bool=false, sort::Bool=true)
10051004
# Allocate space for uv_fs_t struct

doc/src/base/file.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ Base.Filesystem.pwd
77
Base.Filesystem.cd(::AbstractString)
88
Base.Filesystem.cd(::Function)
99
Base.Filesystem.readdir
10-
Base.Filesystem.readdirx
1110
Base.Filesystem.DirEntry
1211
Base.Filesystem.walkdir
1312
Base.Filesystem.mkdir

test/file.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ if !Sys.iswindows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
3131
symlink(subdir, dirlink)
3232
@test stat(dirlink) == stat(subdir)
3333
@test readdir(dirlink) == readdir(subdir)
34-
@test readdirx(dirlink) == readdirx(subdir)
34+
@test Base.Filesystem._readdirx(dirlink) == Base.Filesystem._readdirx(subdir)
3535

3636
# relative link
3737
relsubdirlink = joinpath(subdir, "rel_subdirlink")
3838
reldir = joinpath("..", "adir2")
3939
symlink(reldir, relsubdirlink)
4040
@test stat(relsubdirlink) == stat(subdir2)
4141
@test readdir(relsubdirlink) == readdir(subdir2)
42-
@test readdirx(relsubdirlink) == readdirx(subdir2)
42+
@test Base.Filesystem._readdirx(relsubdirlink) == Base.Filesystem._readdirx(subdir2)
4343

4444
# creation of symlink to directory that does not yet exist
4545
new_dir = joinpath(subdir, "new_dir")
@@ -58,7 +58,7 @@ if !Sys.iswindows() || Sys.windows_version() >= Sys.WINDOWS_VISTA_VER
5858
mkdir(new_dir)
5959
touch(foo_file)
6060
@test readdir(new_dir) == readdir(nedlink)
61-
@test readdirx(new_dir) == readdirx(nedlink)
61+
@test Base.Filesystem._readdirx(new_dir) == Base.Filesystem._readdirx(nedlink)
6262

6363
rm(foo_file)
6464
rm(new_dir)
@@ -1444,10 +1444,10 @@ rm(dirwalk, recursive=true)
14441444
touch(randstring())
14451445
end
14461446
@test issorted(readdir())
1447-
@test issorted(readdirx())
1448-
@test map(o->o.name, readdirx()) == readdir()
1449-
@test map(o->o.path, readdirx()) == readdir(join=true)
1450-
@test count(isfile, readdir(join=true)) == count(isfile, readdirx())
1447+
@test issorted(_readdirx())
1448+
@test map(o->o.name, Base.Filesystem._readdirx()) == readdir()
1449+
@test map(o->o.path, Base.Filesystem._readdirx()) == readdir(join=true)
1450+
@test count(isfile, readdir(join=true)) == count(isfile, Base.Filesystem._readdirx())
14511451
end
14521452
end
14531453
end

0 commit comments

Comments
 (0)