phing-system-io

# Class: Win32FileSystem Source Location: /system/io/Win32FileSystem.php
### Class Overview
    FileSystem
       |
       --Win32FileSystem
#### Author(s): Hans Lellelid <hans@xmpl.org> Charlie Killian <charlie@tizac.com> #### Version: $Revision: 552 $ | ### Variables $altSlash $semicolon $slash | ### Methods __construct compare fromURIPath getDefaultParent getPathSeparator getSeparator isAbsolute isLetter isSlash lister listRoots normalize normalizePrefix normalizer prefixLength resolve resolveFile setReadOnly slashify _access _driveIndex _getDrive _getDriveDirectory _getUserPath _nativeListRoots
### Child classes: WinNTFileSystem FileSystem for Windows NT/2000. | ### Inherited Constants #### Class: FileSystem FileSystem::BA_DIRECTORY FileSystem::BA_EXISTS FileSystem::BA_HIDDEN FileSystem::BA_REGULAR | ### Inherited Methods #### Class: FileSystem FileSystem::canDelete() Whether file can be deleted. FileSystem::canonicalize() canonicalize filename by checking on disk FileSystem::checkAccess() Check whether the file or directory denoted by the given abstract FileSystem::chmod() Change the permissions on a file or directory. FileSystem::chown() Change the ownership on a file or directory. FileSystem::compare() Compare two abstract pathnames lexicographically. FileSystem::compareMTimes() Compare the modified time of two files. FileSystem::copy() Copy a file. FileSystem::createDirectory() Create a new directory denoted by the given abstract pathname, returning true if and only if the operation succeeds. FileSystem::createNewFile() Create a new empty file with the given pathname. Return true if the file was created and false if a file or directory with the given pathname already exists. Throw an IOException if an I/O error occurs. FileSystem::delete() Delete the file or directory denoted by the given abstract pathname, returning true if and only if the operation succeeds. FileSystem::deleteOnExit() Arrange for the file or directory denoted by the given abstract pathname to be deleted when Phing::shutdown is called, returning true if and only if the operation succeeds. FileSystem::fromURIPath() Post-process the given URI path string if necessary. This is used on win32, e.g., to transform "/c:/foo" into "c:/foo". The path string still has slash separators; code in the PhingFile class will translate them after this method returns. FileSystem::getBooleanAttributes() Return the simple boolean attributes for the file or directory denoted by the given abstract pathname, or zero if it does not exist or some other I/O error occurs. FileSystem::getDefaultParent() Return the parent pathname string to be used when the parent-directory argument in one of the two-argument PhingFile constructors is the empty pathname. FileSystem::getFileSystem() Static method to return the FileSystem singelton representing this platform's local filesystem driver. FileSystem::getLastModifiedTime() Return the time at which the file or directory denoted by the given abstract pathname was last modified, or zero if it does not exist or some other I/O error occurs. FileSystem::getLength() Return the length in bytes of the file denoted by the given abstract pathname, or zero if it does not exist, is a directory, or some other I/O error occurs. FileSystem::getPathSeparator() Return the local filesystem's path-separator character. FileSystem::getSeparator() Return the local filesystem's name-separator character. FileSystem::isAbsolute() Tell whether or not the given abstract pathname is absolute. FileSystem::listDir() List the elements of the directory denoted by the given abstract pathname. Return an array of strings naming the elements of the directory if successful; otherwise, return null . FileSystem::listRoots() List the available filesystem roots, return array of PhingFile objects FileSystem::lock() Locks a file and throws an Exception if this is not possible. FileSystem::normalize() Convert the given pathname string to normal form. If the string is already in normal form then it is simply returned. FileSystem::prefixLength() Compute the length of this pathname string's prefix. The pathname string must be in normal form. FileSystem::rename() Rename the file or directory denoted by the first abstract pathname to the second abstract pathname, returning true if and only if the operation succeeds. FileSystem::resolve() Resolve the child pathname string against the parent. FileSystem::resolveFile() Resolve the given abstract pathname into absolute form. Invoked by the getAbsolutePath and getCanonicalPath methods in the PhingFile class. FileSystem::rmdir() Delete an empty directory OR a directory and all of its contents. FileSystem::setLastModifiedTime() Set the last-modified time of the file or directory denoted by the given abstract pathname returning true if and only if the operation succeeds. FileSystem::setReadOnly() Mark the file or directory denoted by the given abstract pathname as read-only, returning true if and only if the operation succeeds. FileSystem::symlink() Symbolically link a file to another name. FileSystem::touch() Set the modification and access time on a file to the present time. FileSystem::umask() Set the umask for file and directory creation. FileSystem::unlink() Delete a file. FileSystem::unlock() Unlocks a file and throws an IO Error if this is not possible.
### Class Details [line 27] #### Tags:
author: | Hans Lellelid <hans@xmpl.org>
author: | Charlie Killian <charlie@tizac.com>
version: | $Revision: 552 $
[ Top ] ### Class Variables #### $altSlash = [line 30] #### Tags:
access: | protected
Type: | mixed
[ Top ] #### $semicolon = [line 31] #### Tags:
access: | protected
Type: | mixed
[ Top ] #### $slash = [line 29] #### Tags:
access: | protected
Type: | mixed
[ Top ] ### Class Methods ### constructor __construct [line 35]
`Win32FileSystem __construct( )`
[ Top ] ### method compare [line 449]
`void compare( PhingFile $f1, PhingFile $f2)`
compares file paths lexicographically Overrides FileSystem::compare() (Compare two abstract pathnames lexicographically.) #### Parameters:
PhingFile | $f1 |
PhingFile | $f2 |
[ Top ] ### method fromURIPath [line 278]
`void fromURIPath( $strPath)`
Overrides FileSystem::fromURIPath() (Post-process the given URI path string if necessary. This is used on win32, e.g., to transform "/c:/foo" into "c:/foo". The path string still has slash separators; code in the PhingFile class will translate them after this method returns.) #### Parameters:
| $strPath |
[ Top ] ### method getDefaultParent [line 274]
`void getDefaultParent( )`
Overrides FileSystem::getDefaultParent() (Return the parent pathname string to be used when the parent-directory argument in one of the two-argument PhingFile constructors is the empty pathname.) [ Top ] ### method getPathSeparator [line 66]
`void getPathSeparator( )`
Overrides FileSystem::getPathSeparator() (Return the local filesystem's path-separator character.) [ Top ] ### method getSeparator [line 61]
`void getSeparator( )`
Overrides FileSystem::getSeparator() (Return the local filesystem's name-separator character.) [ Top ] ### method isAbsolute [line 299]
`void isAbsolute( PhingFile $f)`
Overrides FileSystem::isAbsolute() (Tell whether or not the given abstract pathname is absolute.) #### Parameters:
PhingFile | $f |
[ Top ] ### method isLetter [line 45]
`void isLetter( $c)`
#### Parameters:
| $c |
[ Top ] ### method isSlash [line 41]
`void isSlash( $c)`
#### Parameters:
| $c |
[ Top ] ### method lister [line 459]
`void lister( $f)`
returns the contents of a directory in an array #### Parameters:
| $f |
[ Top ] ### method listRoots [line 423]
`void listRoots( )`
Overrides FileSystem::listRoots() (List the available filesystem roots, return array of PhingFile objects) [ Top ] ### method normalize [line 191]
`string normalize( string $strPath)`
Check that the given pathname is normal. If not, invoke the real normalizer on the part of the pathname that requires normalization. This way we iterate through the whole pathname string only once. Overrides FileSystem::normalize() (Convert the given pathname string to normal form. If the string is already in normal form then it is simply returned.) #### Parameters:
string | $strPath |
[ Top ] ### method normalizePrefix [line 82]
`void normalizePrefix( $strPath, $len, &$sb)`
A normal Win32 pathname contains no duplicate slashes, except possibly for a UNC prefix, and does not end with a slash. It may be the empty string. Normalized Win32 pathnames have the convenient property that the length of the prefix almost uniquely identifies the type of the path and whether it is absolute or relative: relative to both drive and directory drive-relative (begins with '\\') absolute UNC (if first char is '\\'), else directory-relative (has form "z:foo") absolute local pathname (begins with "z:\\") #### Parameters:
| $strPath |
| $len |
| &$sb |
[ Top ] ### method normalizer [line 118]
`void normalizer( $strPath, $len, $offset)`
Normalize the given pathname, whose length is len, starting at the given #### Tags:
access: | protected
#### Parameters:
| $strPath |
| $len |
| $offset |
[ Top ] ### method prefixLength [line 215]
`void prefixLength( $strPath)`
Overrides FileSystem::prefixLength() (Compute the length of this pathname string's prefix. The pathname string must be in normal form.) #### Parameters:
| $strPath |
[ Top ] ### method resolve [line 241]
`void resolve( $parent, $child)`
Overrides FileSystem::resolve() (Resolve the child pathname string against the parent.) #### Parameters:
| $parent |
| $child |
[ Top ] ### method resolveFile [line 347]
`void resolveFile( PhingFile $f)`
Overrides FileSystem::resolveFile() (Resolve the given abstract pathname into absolute form. Invoked by the getAbsolutePath and getCanonicalPath methods in the PhingFile class.) #### Parameters:
PhingFile | $f |
[ Top ] ### method setReadOnly [line 405]
`void setReadOnly( $f)`
Overrides FileSystem::setReadOnly() (Mark the file or directory denoted by the given abstract pathname as read-only, returning true if and only if the operation succeeds.) #### Parameters:
| $f |
[ Top ] ### method slashify [line 50]
`void slashify( $p)`
#### Parameters:
| $p |
[ Top ] ### method _access [line 412]
`void _access( $path)`
#### Tags:
access: | protected
#### Parameters:
| $path |
[ Top ] ### method _driveIndex [line 306]
`void _driveIndex( $d)`
private #### Parameters:
| $d |
[ Top ] ### method _getDrive [line 341]
`void _getDrive( $path)`
#### Parameters:
| $path |
[ Top ] ### method _getDriveDirectory [line 318]
`void _getDriveDirectory( $drive)`
private #### Parameters:
| $drive |
[ Top ] ### method _getUserPath [line 336]
`void _getUserPath( )`
[ Top ] ### method _nativeListRoots [line 419]
`void _nativeListRoots( )`
[ Top ] Documentation generated on Mon, 19 Oct 2009 10:52:22 +0200 by phpDocumentor 1.4.3