ScpExtension extension

on

Methods

getSizeOfDirectory(Pointer<ssh_session_struct> session, String remoteDirectoryPath, {bool isThrowException = true}) int
return total size in bytes of each file inside folder ignoring linux directory metadata size
getSizeOfFile(Pointer<ssh_session_struct> session, String remoteFilePath, {bool isThrowException = true}) int
return total size in bytes of file , work on GNU/Linux systems, tested in debian 10 based on https://unix.stackexchange.com/questions/16640/how-can-i-get-the-size-of-a-file-in-a-bash-script/185039#185039
initDirectoryScp(ssh_session session, Pointer<Int8> remoteDirectoryPath) Pointer<ssh_scp_struct>
initFileScp(ssh_session session, Pointer<Int8> remoteFilePath) Pointer<ssh_scp_struct>
scpDownloadDirectory(Pointer<ssh_session_struct> session, String remoteDirectoryPath, String fullLocalDirectoryPathTarget, {Allocator allocator = calloc, void callbackStats(int totalBytes, int loaded, int currentFileSize, int countDirectory, int countFiles)?, void printLog(Object? obj)?, bool updateStatsOnFileEnd = true, bool isThrowException = false, bool cancelCallback()?, bool dontStopIfFileException = false}) Future?
fullLocalDirectoryPathTarget example c:\downloads this function work only if remote is linux debian like sytem callbackStats function to show stattistcs callbackStats(totalSize, loaded, countDirectory, countFiles) printLog callback for print log messagens updateStatsOnFileEnd if true call callbackStats on file download end , if false call callbackStats on directory end
scpDownloadFileTo(ssh_session session, String fullRemotePathSource, String fullLocalPathTarget, {void callbackStats(int totalBytes, int loaded)?, Allocator allocator = calloc, bool recursive = true, bool cancelCallback()?, bool dontStopIfFileException = false}) Future<void>
scpReadFileAndSave(Pointer<ssh_session_struct> session, Pointer<ssh_scp_struct> scp, Uint8List fullLocalPathTarget, {void callbackStats(int totalBytes, int loaded)?, Allocator allocator = calloc, bool recursive = false, bool cancelCallback()?, bool dontStopIfFileException = false, void printLog(Object? obj)?, int bufferSize = 128 * 1024}) Future<void>
scpReadFileAsString(ssh_session session, String fullPath, {Allocator allocator = calloc}) String
fullPath example => "helloworld/helloworld.txt"