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

download using an absloute path doesn't work if the FTP current directory is not root #121

Open
sylvaticus opened this issue Jul 13, 2023 · 0 comments

Comments

@sylvaticus
Copy link

As from the title, the download function using an absolute path doesn't work if the FTP current directory is not root:

julia> ftp = FTP(hostname = "palantir.boku.ac.at", username = "anonymous", password = "")
URL:       ftp://anonymous@palantir.boku.ac.at/
Transfer:  passive mode
Security:  none

julia> # Download with relative path works:
       download(ftp,"/Public/ImprovedForestCharacteristics/Readme.txt","test/Readme.txt")
IOStream(<file test/Readme.txt>)

julia> cd(ftp,"/Public")     # cd using abs path

julia> println(ftp.ctxt.url)
ftp://anonymous@palantir.boku.ac.at//Public/

julia> # This also works:
       download(ftp,"ImprovedForestCharacteristics/Readme.txt","test/Readme.txt")
IOStream(<file test/Readme.txt>)

julia> # But this on doesn't: downloading a file using an absolute path from a working directory
       # not in the root should still work, but it doesn't:
       download(ftp,"/Public/ImprovedForestCharacteristics/Readme.txt","test/Readme.txt")
ERROR: Failed to download /Public/ImprovedForestCharacteristics/Readme.txt. :: LibCURL error #9
Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/FTPClient/7DJzC/src/FTPC.jl:62 [inlined]
 [2] ftp_perform(ctxt::ConnContext{Bool})
   @ FTPClient ~/.julia/packages/FTPClient/7DJzC/src/conn_context.jl:298
 [3] ftp_get(ctxt::ConnContext{Bool}, file_name::String, save_path::String; mode::FTP_MODE)
   @ FTPClient ~/.julia/packages/FTPClient/7DJzC/src/conn_context.jl:152
 [4] download(ftp::FTP, file_name::String, save_path::String; mode::FTP_MODE)
   @ FTPClient ~/.julia/packages/FTPClient/7DJzC/src/FTPObject.jl:116
 [5] download(ftp::FTP, file_name::String, save_path::String)
   @ FTPClient ~/.julia/packages/FTPClient/7DJzC/src/FTPObject.jl:108
 [6] top-level scope
   @ REPL[66]:3
@sylvaticus sylvaticus changed the title download using an absloute path doesn't work if the FTP current directory is not root download using an absloute path doesn't work if the FTP current directory is not root Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant