FileSystem for Windows NT/2000.
You should also use this class as a template to write your local implementation Some native PHP filesystem specific methods are abstracted here as well. Anyway you must always use this methods via a PhingFile object (that by nature uses the *FileSystem drivers to access the real filesystem via this class using natives.
FIXME: - Error handling reduced to min fallthrough runtime exceptions more precise errorhandling is done by the PhingFile class
package |
phing.system.io |
---|
__construct()
isSlash($c)
isLetter($c)
slashify($p)
getSeparator()
getPathSeparator()
normalizePrefix($strPath, $len, $sb)
0 relative to both drive and directory 1 drive-relative (begins with '\') 2 absolute UNC (if first char is '\'), else directory-relative (has form "z:foo") 3 absolute local pathname (begins with "z:\")
normalizer($strPath, $len, $offset)
normalize(string $strPath)
string
prefixLength(string $pathname)
string
resolve(string $parent, string $child)
Both strings must be in normal form, and the result will be a string in normal form.
string
string
getDefaultParent()
fromURIPath(string $path)
string
isAbsolute(\PhingFile $f)
_driveIndex($d)
_isPharArchive($strPath)
_getDriveDirectory($drive)
_getUserPath()
_getDrive($path)
resolveFile(\PhingFile $f)
setReadOnly(\PhingFile $f)
_access($path)
_nativeListRoots()
listRoots()
throws |
---|
compare(\PhingFile $f1, \PhingFile $f2)
lister($f)
getFileSystem() : \FileSystem
canonicalize(string $strPath) : mixed
string
mixed
Canonical path or false if the file doesn't exist.
getBooleanAttributes(\PhingFile $f)
checkAccess(\PhingFile $f, boolean $write = false)
canDelete(\PhingFile $f) : boolean
getLastModifiedTime(\PhingFile $f) : int
getLength(\PhingFile $f) : int
createNewFile(string $strPathname) : boolean
throws |
---|
string
Path of the file to be created.
boolean
delete(\PhingFile $f, boolean $recursive = false) : void
deleteOnExit(\PhingFile $f)
listDir(\PhingFile $f)
createDirectory(\PhingFile $f, int $mode = 493) : boolean
NOTE: umask() is reset to 0 while executing mkdir(), and restored afterwards
int
boolean
rename(\PhingFile $f1, \PhingFile $f2) : void
throws |
if rename cannot be performed |
---|
setLastModifiedTime(\PhingFile $f, int $time) : void
copy(\PhingFile $src, \PhingFile $dest) : void
throws |
if file cannot be copied. |
---|
copyr(string $source, string $dest) : bool
author |
Aidan Lister aidan@php.net |
---|---|
version | |
link |
http://aidanlister.com/repos/v/function.copyr.php |
string
Source path
string
Destination path
bool
Returns TRUE on success, FALSE on failure
chown(string $pathname, string $user) : void
throws |
if operation failed. |
---|
string
Path and name of file or directory.
string
The user name or number of the file or directory. See http://us.php.net/chown
chgrp(string $pathname, string $group) : void
throws |
if operation failed. |
---|
string
Path and name of file or directory.
string
The group of the file or directory. See http://us.php.net/chgrp
chmod(string $pathname, int $mode) : void
throws |
if operation failed. |
---|
string
Path and name of file or directory.
int
The mode (permissions) of the file or directory. If using octal add leading 0. eg. 0777. Mode is affected by the umask system setting.
lock(\PhingFile $f) : void
unlock(\PhingFile $f) : void
unlink(string $file) : void
throws |
|
---|
string
Path and/or name of file to delete.
symlink(string $target, string $link) : void
Currently symlink is not implemented on Windows. Don't use if the application is to be portable.
string
Path and/or name of file to link.
string
Path and/or name of link to be created.
touch(string $file, int $time = null) : void
string
Path and/or name of file to touch.
int
rmdir($dir, $children = false) : void
umask($mode) : void
throws |
if there is an error performing operation. |
---|
compareMTimes($file1, $file2) : \Int.
throws |
|
---|
\Int.
1 if file1 is newer. -1 if file2 is newer. 0 if files have the same time. Err object on failure.
BA_EXISTS
var |
---|
BA_REGULAR
var |
---|
BA_DIRECTORY
var |
---|
BA_HIDDEN
var |
---|
slash :
altSlash :
semicolon :
driveDirCache :