Stat
Undocumented
-
Creates a
Statinstance withfstatlocated in Darwin library. Internal usesfstatto extractStatinformation from specific file descriptor.Declaration
Swift
public init(_ fileno: Int)Parameters
filenoA file number
-
Creates a
Statinstance withstatlocated in Darwin library. Internal usesstatto extractStatinformation from specific path.Declaration
Swift
public init(_ path: String)Parameters
pathA file path.
-
Returns the last access time for this file as an object of class
Date.Declaration
Swift
public var atime: Date -
Returns the birth time for stat.
Declaration
Swift
public var birthtime: Date -
Returns the native file system’s block size.
Declaration
Swift
public var blksize: Int -
Returns the number of native file system blocks allocated for this file.
Declaration
Swift
public var blocks: Int -
Returns the change time for stat (that is, the time directory information about the file was changed, not the file itself).
Declaration
Swift
public var ctime: Date -
Returns an integer representing the device on which stat resides.
Declaration
Swift
public var dev: Int -
Returns the numeric group id of the owner of stat.
Declaration
Swift
public var gid: Int -
Returns true if the effective group id of the process is the same as the group id of stat.
Declaration
Swift
public var isGroupOwned: Bool -
Returns the inode number for stat.
Declaration
Swift
public var ino: Int -
Returns an integer representing the permission bits of stat.
Declaration
Swift
public var mode: Int -
Returns the modification time of stat.
Declaration
Swift
public var mtime: Date -
Returns the number of hard links to stat.
Declaration
Swift
public var nlink: Int -
Returns true if the effective user id of the process is the same as the owner of stat.
Declaration
Swift
public var isOwned: Bool -
Returns an integer representing the device type on which stat resides.
Declaration
Swift
public var rdev: Int -
Returns the size of stat in bytes.
Declaration
Swift
public var size: Int -
Returns the numeric user id of the owner of stat.
Declaration
Swift
public var uid: Int -
Returns true if stat is a zero-length file; false otherwise.
Declaration
Swift
public var isZero: Bool
-
Returns true if stat has the set-group-id permission bit set, false if it doesn’t or if the operating system doesn’t support this feature.
Declaration
Swift
public var isSetgid: Bool -
Returns true if stat has the set-user-id permission bit set, false if it doesn’t or if the operating system doesn’t support this feature.
Declaration
Swift
public var isSetuid: Bool -
Returns true if stat has its sticky bit set, false if it doesn’t or if the operating system doesn’t support this feature.
Declaration
Swift
public var isSticky: Bool -
Returns true if the file is a block device, false if it isn’t or if the operating system doesn’t support this feature.
Declaration
Swift
public var isBlockDev: Bool -
Returns true if the file is a character device, false if it isn’t or if the operating system doesn’t support this feature.
Declaration
Swift
public var isCharDev: Bool -
Returns true if stat is a regular file (not a device file, pipe, socket, etc.).
Declaration
Swift
public var isFile: Bool -
Returns true if the named file is a directory, or a symlink that points at a directory, and false otherwise.
Declaration
Swift
public var isDirectory: Bool -
Returns true if the operating system supports pipes and stat is a pipe; false otherwise.
Declaration
Swift
public var isPipe: Bool -
Returns true if stat is a socket, false if it isn’t or if the operating system doesn’t support this feature.
Declaration
Swift
public var isSocket: Bool -
Returns true if stat is a symbolic link, false if it isn’t or if the operating system doesn’t support this feature.
Declaration
Swift
public var isSymlink: Bool -
Identifies the type of the named file; the return string is one of
file
,directory
,characterSpecial
,blockSpecial
,fifo
,link
,socket
, orunknown
.Declaration
Swift
public var ftype: String
-
A textual representation of this instance.
Instead of accessing this property directly, convert an instance of any type to a string by using the
String(describing:)initializer. For example:struct Point: CustomStringConvertible { let x: Int, y: Int var description: String { return "(\(x), \(y))" } } let p = Point(x: 21, y: 30) let s = String(describing: p) print(s) // Prints "(21, 30)"The conversion of
pto a string in the assignment tosuses thePointtype’sdescriptionproperty.Declaration
Swift
public var description: String -
Produce a nicely formatted description of stat.
Declaration
Swift
public var inspect: String
View on GitHub
Stat Class Reference