SFtpDir C Reference Documentation

SFtpDir

Represents a remote SFTP directory listing.

Create/Dispose

HCkSFtpDir CkSFtpDir_Create(void);

Creates an instance of the HCkSFtpDir object and returns a handle (i.e. a "void *" pointer). The handle is passed in the 1st argument for the functions listed on this page.

void CkSFtpDir_Dispose(HCkSFtpDir handle);

Objects created by calling CkSFtpDir_Create must be freed by calling this method. A memory leak occurs if a handle is not disposed by calling this function. Also, any handle returned by a Chilkat "C" function must also be freed by the application by calling the appropriate Dispose method, such as CkSFtpDir_Dispose.

Properties

int CkSFtpDir_getNumFilesAndDirs(HCkSFtpDir cHandle);

The number of entries in this directory listing.

void CkSFtpDir_getOriginalPath(HCkSFtpDir cHandle, HCkString retval);

const char *CkSFtpDir_originalPath(HCkSFtpDir cHandle);

The original path used to fetch this directory listing. This is the string that was originally passed to the OpenDir method when the directory was read.

BOOL CkSFtpDir_getUtf8(HCkSFtpDir cHandle);

void CkSFtpDir_putUtf8(HCkSFtpDir cHandle, BOOL newVal);

When set to TRUE, all "const char *" arguments are interpreted as utf-8 strings. If set to FALSE (the default), then "const char *" arguments are interpreted as ANSI strings. Also, when set to TRUE, and Chilkat method returning a "const char *" is returning the utf-8 representation. If set to FALSE, all "const char *" return values are ANSI strings.

Methods

HCkSFtpFile CkSFtpDir_GetFileObject(HCkSFtpDir cHandle, int index);

Returns the Nth entry in the directory. Indexing begins at 0.

BOOL CkSFtpDir_GetFilename(HCkSFtpDir cHandle, int index, HCkString outStr);

const char *CkSFtpDir_getFilename(HCkSFtpDir cHandle, int index);

Returns the Nth filename in the directory (indexing begins at 0).

Returns TRUE for success, FALSE for failure.

BOOL CkSFtpDir_LoadTaskResult(HCkSFtpDir cHandle, HCkTask task);

Introduced in version 9.5.0.52

Loads the SFTP directory object from a completed asynchronous task.

Returns TRUE for success, FALSE for failure.