Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   7.6    Statistic  

CURL.SetOptionDirListOnly

Whether to only query names in file listing.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CURL 2.5 Yes Yes Yes Yes Yes

MBS( "CURL.SetOptionDirListOnly"; Handle; Value )

(old name: CURL.SetOptionFTPListOnly)

Parameters

Parameter Description Example value
Handle The CURL session handle. $curl
Value Whether to limit directory listing to names only. 1

Result

Returns "OK" on success.

Description

Whether to only query names in file listing.
A parameter set to 1 tells the library to just list the names of files in a directory, instead of doing a full directory listing that would include file sizes, dates etc. This works for FTP and SFTP URLs.

This causes an FTP NLST command to be sent on an FTP server. Beware that some FTP servers list only files in their response to NLST; they might not include subdirectories and symbolic links.

Examples

List only file names:

MBS( "CURL.SetOptionDirListOnly"; $curl; 1 )

Full listing:

MBS( "CURL.SetOptionDirListOnly"; $curl; 0 )

Query list of files in FTP/SFTP folder:

Set Variable [$curl; Value:MBS("CURL.New")]
# set download URL, e.g. sftp://monkeybreadsoftware.net/
Set Variable [$result; Value:MBS("CURL.SetOptionURL"; $curl; SFTP Download::URL )]
# set credentials
Set Variable [$result; Value:MBS("CURL.SetOptionUsername"; $curl; SFTP Download::UserName )]
Set Variable [$result; Value:MBS("CURL.SetOptionPassword"; $curl; SFTP Download::Password )]
# login only via password
Set Variable [$result; Value:MBS( "CURL.SetOptionSSHAuthTypes"; $curl; 2+8 )]
# only get list of file/dir names
Set Variable [$result; Value:MBS("CURL.SetOptionDirListOnly"; $curl; 1)]
# run transfer
Set Field [SFTP Download::ErrorCode; MBS("CURL.Perform"; $curl)]
# check debug log for errors
Set Field [SFTP Download::Debug; MBS("CURL.GetDebugAsText"; $curl)]
Set Field [SFTP Download::FileList; MBS("CURL.GetResultAsText"; $curl)]
# free CURL session
Set Variable [$result; Value:MBS("CURL.Cleanup"; $curl)]

See also


CURL.SetOptionDNSLocalIPv6   -   CURL.SetOptionEGDSocket

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins