SFTPClient.jl Documentation
Base.Filesystem.cd
— Methodcd(sftp::SFTP, dir::AbstractString)
-Change the directory for the SFTP client.
Base.Filesystem.mkdir
— Methodmkdir(sftp::SFTP, dir::AbstractString)
+Change the directory for the SFTP client.
Base.Filesystem.mkdir
— Methodmkdir(sftp::SFTP, dir::AbstractString)
-Create a directory
Base.Filesystem.mv
— Methodmv( sftp::SFTP, oldname::AbstractString, newname::AbstractString; )
Move, i.e., rename the file.
Base.Filesystem.readdir
— Functionreaddir(sftp::SFTP, join::Bool = false, sort::Bool = true)
Reads the current directory. Returns a vector of Strings just like the regular readdir function.
Base.Filesystem.rm
— Methodrm(sftp::SFTP, file_name::AbstractString)
+Create a directory
Base.Filesystem.mv
— Methodmv( sftp::SFTP, oldname::AbstractString, newname::AbstractString; )
Move, i.e., rename the file.
Base.Filesystem.readdir
— Functionreaddir(sftp::SFTP, join::Bool = false, sort::Bool = true)
Reads the current directory. Returns a vector of Strings just like the regular readdir function.
Base.Filesystem.rm
— Methodrm(sftp::SFTP, file_name::AbstractString)
-Remove (delete) the file
SFTPClient.download
— FunctionSFTP.download( sftp::SFTP, file_name::AbstractString, output = tempname();downloadDir::Union{String, Nothing}=nothing)
Download a file. You can download it and use it directly, or save it to a file.
+Remove (delete) the file
SFTPClient.download
— FunctionSFTP.download( sftp::SFTP, file_name::AbstractString, output = tempname();downloadDir::Union{String, Nothing}=nothing)
Download a file. You can download it and use it directly, or save it to a file.
Specify downloadDir if you want to save downloaded files. You can also use broadcasting.
Example:
@@ -15,6 +15,6 @@
SFTPClient.download.(sftp, files, downloadDir=downloadDir)
You can also use it like this:
-df=DataFrame(CSV.File(SFTPClient.download(sftp, "/mydir/test.csv")))
SFTPClient.rmdir
— Methodrmdir(sftp::SFTP, dir_name::AbstractString)
+df=DataFrame(CSV.File(SFTPClient.download(sftp, "/mydir/test.csv")))
SFTPClient.rmdir
— Methodrmdir(sftp::SFTP, dir_name::AbstractString)
-Remove (delete) the directory
SFTPClient.upload
— Methodupload(sftp::SFTP, file_name::AbstractString)
Upload (put) a file to the server. Broadcasting can be used too.
files=readdir() upload.(sftp,files)
SFTPClient.SFTP
— Methodfunction SFTP(url::AbstractString, username::AbstractString, password::AbstractString;createknownhostsentry=true, disableverifypeer=false, disableverify_host=false)
Creates a new SFTP Client: url: The url to connect to, e.g., sftp://mysite.com username: The username to use password: The users password createknownhosts_entry: Automatically create an entry in known hosts
Example: sftp = SFTP("sftp://test.rebex.net", "demo", "password")
SFTPClient.SFTP
— Methodfunction SFTP(url::AbstractString, username::AbstractString;disableverifypeer=false, disableverifyhost=false)
Creates a new SFTP client using certificate authentication. Provide the username in the url
sftp = SFTP("sftp://mysitewhereIhaveACertificate.com", "myuser")
Note! You must provide the username for this to work.
Before using this method, you must set up your certificates in ~/.ssh/idrsa and ~/.ssh/idrsa.pub
Of course, the server need to be in the known_hosts file as well.
Test using your local client first: ssh myuser@mysitewhereIhaveACertificate.com