Futilities/human/lib/caPathPiece
< Futilities | human | lib
Jump to navigation
Jump to search
Human Futilities:
caPathPiece class |
Functions
action
public function AddSegment(string $fn) : cPathCap { return new cPathCap($fn,$this); }
figuring
public function GetSpec()
: string - returns entire filespec, including basepublic function GetPath() : string
- returns entire filespec relative to base
file system: objects
abstract public function GetPathStatus() : cPathStatus;
public function GetFileNode() : cFile { ... }
: creates a cFile for the current filespecpublic function GetFolderNode() : cFolder { ... }
: creates a cFolder for the current filespec
file system: I/O
Note that this is I/O to the file system, not file contents.
public function Exists() : bool { return file_exists($this->GetSpec()); }
public function IsLink() : bool { return is_link($this->GetSpec()); }
protected function GetPerms() { return fileperms($this->GetSpec()); }
public function GetTimestamp() : int { return filemtime($this->GetSpec()); }
public function SetTimestamp(int $dt) { touch($this->GetSpec(),$dt); }
public function IsFile() : bool { return is_file($this->GetSpec()); }
public function IsFolder() : bool { return is_dir($this->GetSpec()); }
public function IsCopyable() : bool { return is_readable($this->GetSpec()); }
public function IsPipe() : bool { return (($this->GetPerms() & 010000) != 0); }
public function GetSize() : int { return filesize($this->GetSpec()); }
public function GetDir() : \Directory { ... }
public function GetInfo() : cnFileInfo { return new cnFileInfo(@stat($this->GetSpec())); }