FtpFileType uses ConstantsTrait
Enumerates the kinds of entry returned by a remote directory listing, and maps the various server representations (MLSD facts, `ls -l` type characters) onto them.
Tags
Table of Contents
Constants
- DIRECTORY : string = 'dir'
- A directory.
- FILE : string = 'file'
- A regular file.
- LINK : string = 'link'
- A symbolic link.
- UNKNOWN : string = 'unknown'
- An entry whose kind could not be determined.
Methods
- fromMlsd() : string
- Maps an MLSD `type` fact to a file-type constant.
- fromUnixChar() : string
- Maps the leading character of a Unix `ls -l` line to a file-type constant.
Constants
DIRECTORY
A directory.
public
string
DIRECTORY
= 'dir'
FILE
A regular file.
public
string
FILE
= 'file'
LINK
A symbolic link.
public
string
LINK
= 'link'
UNKNOWN
An entry whose kind could not be determined.
public
string
UNKNOWN
= 'unknown'
Methods
fromMlsd()
Maps an MLSD `type` fact to a file-type constant.
public
static fromMlsd(string $type) : string
The cdir (current) and pdir (parent) MLSD types are reported as directories.
Parameters
- $type : string
-
The MLSD type fact.
Return values
string —One of the file-type constants.
fromUnixChar()
Maps the leading character of a Unix `ls -l` line to a file-type constant.
public
static fromUnixChar(string $char) : string
Parameters
- $char : string
-
The first character of the permissions field.
Return values
string —One of the file-type constants.