Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No method matching isdirpath(::PosixPath)? #119

Open
singularitti opened this issue Jun 8, 2021 · 1 comment
Open

No method matching isdirpath(::PosixPath)? #119

singularitti opened this issue Jun 8, 2021 · 1 comment
Labels
enhancement New feature or request RFC

Comments

@singularitti
Copy link

The function isdirpath is not extened on AbstractPaths. So the following code won't work:

julia> cwd() |> isdirpath
ERROR: MethodError: no method matching isdirpath(::PosixPath)
Closest candidates are:
  isdirpath(::String) at path.jl:117
  isdirpath(::AbstractString) at path.jl:552
Stacktrace:
 [1] |>(x::PosixPath, f::typeof(isdirpath))
   @ Base ./operators.jl:858
 [2] top-level scope
   @ REPL[11]:1
@rofinn
Copy link
Owner

rofinn commented Nov 17, 2021

That's because the current isdirpath is awkward and a kinda pointless function. There's no clear definition of what it should return for various filesystems. Whatisdirpath returns doesn't have any bearing on what isdir(fp) returns, which is what I think most people care about? I think in order for that to be useful we'd need to update the Filesystem API to consistently return a valid isdirpath whenever it returns a directory (e.g., splitdir, homedir, pwd). If we did that then I'd consider adding that here, and possibly unifying some of the logic from AWSS3.S3Path.

@rofinn rofinn added enhancement New feature or request RFC labels Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request RFC
Projects
None yet
Development

No branches or pull requests

2 participants