TrustCore SDK NanoSSH API reference  version 7.0
SFTP Client put Functions

Functions

MOC_EXTERN sbyte4 SSHC_sftpNumBytesWritten (sftpcFileHandleDescr *p_sftpFileHandleDescr)
 Get the number of bytes written to an open file. More...
 
MOC_EXTERN void SSHC_sftpSetWriteBuffer (sftpcFileHandleDescr *p_sftpFileHandleDescr, sbyte *pBuffer)
 Point a write buffer to a chunk of data to be transfered. More...
 
MOC_EXTERN void SSHC_sftpSetWriteBufferSize (sftpcFileHandleDescr *p_sftpFileHandleDescr, sbyte4 bufSize)
 Set the size of a write buffer pointing to a chunk of data to be transfered. More...
 
MOC_EXTERN sbyte * SSHC_sftpWriteBuffer (sftpcFileHandleDescr *p_sftpFileHandleDescr)
 Get a pointer to a file's write data buffer. More...
 
MOC_EXTERN sbyte4 SSHC_sftpWriteBufferSize (sftpcFileHandleDescr *p_sftpFileHandleDescr)
 Get the number of bytes in a file's write buffer. More...
 
MOC_EXTERN sbyte4 SSHC_sftpWriteLocation (sftpcFileHandleDescr *p_sftpFileHandleDescr)
 Get a file's current write location. More...
 

Detailed Description

Function Documentation

◆ SSHC_sftpNumBytesWritten()

MOC_EXTERN sbyte4 SSHC_sftpNumBytesWritten ( sftpcFileHandleDescr p_sftpFileHandleDescr)

This function returns the number of bytes already written to the specified open file. Typically an application first calls SSHC_openFile() and then calls this function to keep track of upload (write) progress.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSH_CLIENT__
  • __ENABLE_MOCANA_SSH_FTP_CLIENT__

sshc.h

Parameters
p_sftpFileHandleDescrPointer to file handle descriptor.
Returns
Number of bytes already written to the file.
Remarks
This function is applicable to synchronous SFTP clients.
Note
After the file download (read) is complete, the file should be closed by calling SSHC_closeFile().

sshc.h

◆ SSHC_sftpSetWriteBuffer()

MOC_EXTERN void SSHC_sftpSetWriteBuffer ( sftpcFileHandleDescr p_sftpFileHandleDescr,
sbyte *  pBuffer 
)

This function points a write buffer to a chunk of data to be transfered.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSH_CLIENT__
  • __ENABLE_MOCANA_SSH_FTP_CLIENT__

sshc_filesys.h

Parameters
p_sftpFileHandleDescrPointer to a file handle descriptor whose write buffer pointer you want to set.
pBufferPointer to chunk of data to transfer.
Returns
None.
Remarks
This function is applicable to synchronous SFTP clients.
See also
SSHC_sftpSetWriteBufferSize()

sshc_ftp.c

◆ SSHC_sftpSetWriteBufferSize()

MOC_EXTERN void SSHC_sftpSetWriteBufferSize ( sftpcFileHandleDescr p_sftpFileHandleDescr,
sbyte4  bufSize 
)

This function sets the size of a write buffer pointing to a chunk of data to be transfered.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSH_CLIENT__
  • __ENABLE_MOCANA_SSH_FTP_CLIENT__

sshc_filesys.h

Parameters
p_sftpFileHandleDescrPointer to a file handle descriptor whose write buffer size you want to set.
bufSizeNumber of bytes to set the write buffer size to.
Returns
None.
Remarks
This function is applicable to synchronous SFTP clients.
See also
SSHC_sftpSetWriteBuffer()

sshc_ftp.c

◆ SSHC_sftpWriteBuffer()

MOC_EXTERN sbyte* SSHC_sftpWriteBuffer ( sftpcFileHandleDescr p_sftpFileHandleDescr)

This function returns a pointer to a buffer in which data written to a file is stored.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSH_CLIENT__
  • __ENABLE_MOCANA_SSH_FTP_CLIENT__

sshc.h

Parameters
p_sftpFileHandleDescrPointer to file handle descriptor.
Returns
Pointer to a buffer containing a file's write data.
Remarks
This function is applicable to synchronous SFTP clients.
See also
SSHC_sftpWriteBufferSize

sshc.h

◆ SSHC_sftpWriteBufferSize()

MOC_EXTERN sbyte4 SSHC_sftpWriteBufferSize ( sftpcFileHandleDescr p_sftpFileHandleDescr)

This function returns the number of bytes in the specified file descriptor's write buffer.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSH_CLIENT__
  • __ENABLE_MOCANA_SSH_FTP_CLIENT__

sshc.h

Parameters
p_sftpFileHandleDescrPointer to file handle descriptor.
Returns
Number of bytes in the file's write buffer.
Remarks
This function is applicable to synchronous SFTP clients.
See also
SSHC_sftpReadBuffer

sshc.h

◆ SSHC_sftpWriteLocation()

MOC_EXTERN sbyte4 SSHC_sftpWriteLocation ( sftpcFileHandleDescr p_sftpFileHandleDescr)

This function returns the specified file descriptor's current write location. The read file upcall typically calls this function to track write progress.

Since
1.41
Version
1.41 and later

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

  • __ENABLE_MOCANA_SSH_CLIENT__
  • __ENABLE_MOCANA_SSH_FTP_CLIENT__

sshc.h

Parameters
p_sftpFileHandleDescrPointer to file handle descriptor.
Returns
0-based byte index of file's current write location.
Remarks
This function is applicable to synchronous SFTP clients.

sshc.h