Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 7.2   7.3   7.4   7.5   8.0   8.1   8.2   8.3   8.4   8.5    Statistic  

CURL.FileInfos

Queries file listing as JSON.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CURL 8.5 Yes Yes Yes Yes Yes
MBS( "CURL.FileInfos"; curl )   More

Parameters

Parameter Description Example value
curl The CURL session handle. $curl

Result

Returns JSON or error.

Description

Queries file listing as JSON.
Requires wild card being enabled (CURL.SetOptionWildCardMatch) and an URL with a pattern, e.g. * at the end.

The JSON is an array of objects. Each object includes the following values:

hasFileNameWhether file name is known.
hasFiletypeWhether file type is known.
hasTimeWhether time is known.
hasPermWhether file permissions are known.
hasUIDWhether UID is known.
hasGIDWhether GID is known.
hasSizeWhether file size is known.
hasHardLinkCountWhether hard link count is known.
FileNameThe file name.
FileTypeThe file type. Usually file, directory or symlink.
TimeThe time as returned from server.
PermThe permissions as returned from server.
UserThe user name as returned from server.
GroupThe group name as returned from server.
TargetThe target file path of the symbolic link.
HardLinksThe number of hard links to this file.
SizeThe file size in bytes.
UIDThe user ID if known.
GIDThe group ID if known.
PermissionsThe file permissions as octal number as text, e.g. 755.
TimeValueThe unix time stamp.
YearThe year of the time, if available.
MonthThe month of the time, if available.
DayThe day of the time, if available.
HourThe hour of the time, if available.
MinuteThe minute of the time, if available.
SecondThe second of the time, if available.

As various servers return different listings, we can not always know all fields.
Some servers don't give the year, so we assume this year and last year depending on month and day.

Examples

Query file list:

Set Variable [ $curl ; Value: MBS("CURL.New") ]
Set Variable [ $r ; Value: MBS( "CURL.SetOptionWildCardMatch"; $curl; 1 ) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionURL"; $curl; CURL Test::URL & "*" ) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionPassword"; $curl; CURL Test::Password) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionUsername"; $curl; CURL Test::Name) ]
Set Variable [ $result ; Value: MBS("CURL.SetOptionVerbose"; $curl; 1) ]
Set Field [ CURL Test::Result ; MBS("CURL.Perform"; $curl) ]
Set Field [ CURL Test::listing ; MBS( "JSON.Colorize"; MBS("CURL.FileInfos"; $curl)) ]
Set Field [ CURL Test::debug ; MBS("CURL.GetDebugAsText"; $curl) ]
Set Variable [ $result ; Value: MBS("CURL.Cleanup"; $curl) ]

See also

Created 16th October 2018, last changed 16th October 2018


CURL.ErrorMessage   -   CURL.FormAddKeyContainer

Feedback: Report problem or ask question.




Links
MBS Xojo Chart Plugins