Skip to content

Commit

Permalink
readdir: use arg name dir instead of path
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKarpinski committed Aug 29, 2019
1 parent 4bf946a commit 116cfab
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions base/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -691,15 +691,14 @@ julia> readdir("/home/JuliaUser/Projects/julia")
"usr-staging"
```
"""
function readdir(path::AbstractString)
function readdir(dir::AbstractString)
# Allocate space for uv_fs_t struct
uv_readdir_req = zeros(UInt8, ccall(:jl_sizeof_uv_fs_t, Int32, ()))

# defined in sys.c, to call uv_fs_readdir, which sets errno on error.
err = ccall(:uv_fs_scandir, Int32, (Ptr{Cvoid}, Ptr{UInt8}, Cstring, Cint, Ptr{Cvoid}),
C_NULL, uv_readdir_req, path, 0, C_NULL)
err < 0 && throw(SystemError("unable to read directory $path", -err))
#uv_error("unable to read directory $path", err)
C_NULL, uv_readdir_req, dir, 0, C_NULL)
err < 0 && throw(SystemError("unable to read directory $dir", -err))

# iterate the listing into entries
entries = String[]
Expand Down

0 comments on commit 116cfab

Please sign in to comment.