![]() |
TrustCore SDK NanoSSH API reference
version 7.0
|
Functions | |
| MOC_EXTERN sbyte4 | SSHC_getFileStat (sbyte4 connectionInstance, ubyte *pGetStatFile, ubyte4 getStatFileLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr) |
| Get a file's statistics from an SFTP server. More... | |
| MOC_EXTERN sbyte4 | SSHC_mkdir (sbyte4 connectionInstance, ubyte *pNewDirName, ubyte4 newDirNameLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr, void *pFuture) |
| Create a directory on an SFTP server. More... | |
| MOC_EXTERN sbyte4 | SSHC_realpath (sbyte4 connectionInstance, ubyte *pRealpath, ubyte4 realpathLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr, ubyte **ppRetRealpath, ubyte4 *pRetRealpathLen) |
| Get the fully-qualified directory path of an an SSH Client's virtual directory. More... | |
| MOC_EXTERN sbyte4 | SSHC_removeFile (sbyte4 connectionInstance, ubyte *pRemoveFileName, ubyte4 removeFileNameLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr) |
| Delete a file from an SFTP server. More... | |
| MOC_EXTERN sbyte4 | SSHC_rmdir (sbyte4 connectionInstance, ubyte *pRemoveDirName, ubyte4 removeDirNameLen, sftpcFileHandleDescr **pp_sftpFileHandleDescr) |
| Delete a directory from an SFTP server. More... | |
| MOC_EXTERN sbyte4 SSHC_getFileStat | ( | sbyte4 | connectionInstance, |
| ubyte * | pGetStatFile, | ||
| ubyte4 | getStatFileLen, | ||
| sftpcFileHandleDescr ** | pp_sftpFileHandleDescr | ||
| ) |
This function sends a request to the connected SSH/SFTP server to return the specified file's statistics, such as file size and type.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__ __ENABLE_MOCANA_SSH_FTP_CLIENT__ | connectionInstance | Connection instance returned from SSHC_connect(). |
| pGetStatFile | Pointer to buffer containing name of file to evaluate. |
| getStatFileLen | Number of bytes (characters) in the filename (getStatFileLen). |
| pp_sftpFileHandleDescr | Pointer to address of handle descriptor structure, which on return contains file's statistics. |
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.| MOC_EXTERN sbyte4 SSHC_mkdir | ( | sbyte4 | connectionInstance, |
| ubyte * | pNewDirName, | ||
| ubyte4 | newDirNameLen, | ||
| sftpcFileHandleDescr ** | pp_sftpFileHandleDescr, | ||
| void * | pFuture | ||
| ) |
This function sends create directory request to the connected SSH/SFTP server to create a directory as specified by the function parameter values.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__ __ENABLE_MOCANA_SSH_FTP_CLIENT__ | connectionInstance | Connection instance returned from SSHC_connect(). |
| pNewDirName | Pointer to buffer containing desired directory name. |
| newDirNameLen | Number of bytes (characters) in the desired directory name (pNewDirName). |
| pp_sftpFileHandleDescr | Pointer to address of handle descriptor structure, which on return contains the created directory's information. |
| pFuture | (Reserved for future use.) |
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.| MOC_EXTERN sbyte4 SSHC_realpath | ( | sbyte4 | connectionInstance, |
| ubyte * | pRealpath, | ||
| ubyte4 | realpathLen, | ||
| sftpcFileHandleDescr ** | pp_sftpFileHandleDescr, | ||
| ubyte ** | ppRetRealpath, | ||
| ubyte4 * | pRetRealpathLen | ||
| ) |
This function retrieves (from the connected SSH/SFTP server) the fully-qualified directory path corresponding to the specified SSH Client's virtual directory. This is useful for converting path names containing ".." components, or relative pathnames without a leading slash, into absolute paths.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__ __ENABLE_MOCANA_SSH_FTP_CLIENT__ | connectionInstance | Connection instance returned from SSHC_connect(). |
| pRealpath | Pointer to buffer containing SSH Client's virtual directory name. |
| realpathLen | Number of bytes (characters) in the virtual directory name (pRealpath). |
| pp_sftpFileHandleDescr | Pointer to address of handle descriptor structure, which on return contains real directory's information. |
| ppRetRealpath | Pointer to address of ubyte buffer, which on return contains the real directory's name as a string. |
| pRetRealpathLen | Pointer to ubyte4, which on return contains the number of bytes in the real directory's name (ppRetRealpath). |
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.| MOC_EXTERN sbyte4 SSHC_removeFile | ( | sbyte4 | connectionInstance, |
| ubyte * | pRemoveFileName, | ||
| ubyte4 | removeFileNameLen, | ||
| sftpcFileHandleDescr ** | pp_sftpFileHandleDescr | ||
| ) |
This function sends a delete file request to the connected SSH/SFTP server.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__ __ENABLE_MOCANA_SSH_FTP_CLIENT__ | connectionInstance | Connection instance returned from SSHC_connect(). |
| pRemoveFileName | Pointer to buffer containing name of file to delete. |
| removeFileNameLen | Number of bytes (characters) in the filename (pRemoveFileName). |
| pp_sftpFileHandleDescr | Pointer to address of file's handle descriptor structure; on return it will be NULL. |
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.| MOC_EXTERN sbyte4 SSHC_rmdir | ( | sbyte4 | connectionInstance, |
| ubyte * | pRemoveDirName, | ||
| ubyte4 | removeDirNameLen, | ||
| sftpcFileHandleDescr ** | pp_sftpFileHandleDescr | ||
| ) |
This function sends a delete direcotyr request to the connected SSH/SFTP server.
To enable this function, the following flags must be defined in moptions.h:
__ENABLE_MOCANA_SSH_CLIENT__ __ENABLE_MOCANA_SSH_FTP_CLIENT__ | connectionInstance | Connection instance returned from SSHC_connect(). |
| pRemoveDirName | Pointer to buffer containing name of directory to delete. |
| removeDirNameLen | Number of bytes (characters) in the directory name (pRemoveDirName). |
| pp_sftpFileHandleDescr | Pointer to address of directory's handle descriptor structure; on return it will be NULL. |
OK (0) if successful; otherwise a negative number error code definition from merrors.h. To retrieve a string containing an English text error identifier corresponding to the function's returned error status, use the DISPLAY_ERROR macro.