TrustCore SDK NanoSSH API reference  version 7.0

Variables

sbyte4(* sftpSettings::funcPtrGetFileStats )(sbyte4 connectionInstance, ubyte *pPath, ubyte *pPathExt, sftpFileObjDescr *p_sftpFileDescr)
 Respond to a user's request for file metadata. More...
 
sbyte4(* sftpSettings::funcPtrGetOpenFileStats )(sbyte4 connectionInstance, sbyte4 cookie, sftpFileObjDescr *p_sftpFileDescr)
 Respond to a user's request for an open file's metadata. More...
 
sbyte4(* sftpSettings::funcPtrRemoveFile )(sbyte4 connectionInstance, sbyte *pRemoveFilename)
 Respond to a file remove (delete) request. More...
 
sbyte4(* sftpSettings::funcPtrRenameFile )(sbyte4 connectionInstance, sbyte *pOldFilename, sbyte *pNewFilename)
 Respond to a file rename request. More...
 

Detailed Description

Variable Documentation

◆ funcPtrGetFileStats

sbyte4(* sftpSettings::funcPtrGetFileStats) (sbyte4 connectionInstance, ubyte *pPath, ubyte *pPathExt, sftpFileObjDescr *p_sftpFileDescr)

This callback function is invoked when a user wants to get metadata about a file, such as file size or permissions.

Since
1.41
Version
1.41 and later

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSH_FTP_SERVER__
Parameters
connectionInstanceConnection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection().
pPathPointer to string specifying full directory path of the file.
pPathExtPointer to string containing file name.
p_sftpFileDescrOn return, pointer to structure containing a single file's or directory's descriptor.
Returns
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.

sftp.h

◆ funcPtrGetOpenFileStats

sbyte4(* sftpSettings::funcPtrGetOpenFileStats) (sbyte4 connectionInstance, sbyte4 cookie, sftpFileObjDescr *p_sftpFileDescr)

This callback function is invoked when a user wants to get metadata about an open file, such as file size or permissions.

Since
2.02
Version
2.02 and later

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSH_FTP_SERVER__
Parameters
connectionInstanceConnection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection().
cookieApplication-specific data (typically a file descriptor).
p_sftpFileDescrOn return, pointer to structure containing a single file's or directory's descriptor.
Returns
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.

sftp.h

◆ funcPtrRemoveFile

sbyte4(* sftpSettings::funcPtrRemoveFile) (sbyte4 connectionInstance, sbyte *pRemoveFilename)

This callback function is invoked when a user issues a file remove (delete) request.

Since
1.41
Version
1.41 and later

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSH_FTP_SERVER__
Parameters
connectionInstanceConnection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection().
pRemoveFilenamePointer to string containing name of the file to remove (delete).
Returns
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.

sftp.h

◆ funcPtrRenameFile

sbyte4(* sftpSettings::funcPtrRenameFile) (sbyte4 connectionInstance, sbyte *pOldFilename, sbyte *pNewFilename)

This callback function is invoked when a user issues a file rename request.

Since
1.41
Version
1.41 and later

To enable this function, the following flag must be defined in moptions.h:

  • __ENABLE_MOCANA_SSH_FTP_SERVER__
Parameters
connectionInstanceConnection instance returned from SSH_acceptConnection() or SSH_ASYNC_acceptConnection().
pOldFilenamePointer to string containing existing file name.
pNewFilenamePointer to string containing new file name.
Returns
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.

sftp.h