# classes/phing/system/io/UnixFileSystem.php

UnixFileSystem class. This class encapsulates the basic file system functions for platforms using the unix (posix)-stylish filesystem. It wraps php native functions suppressing normal PHP error reporting and instead uses Exception to report and error.

This class is part of a oop based filesystem abstraction and targeted to run on all supported php platforms.

Note: For debugging turn track_errors on in the php.ini. The error messages and log messages from this class will then be clearer because $php_errormsg is passed as part of the message.

FIXME: - Comments - Error handling reduced to min, error are handled by PhingFile mainly

author
  Andreas Aderhold, andi@binarycloud.com
package
  phing.system.io
version
  $Revision: 1237 $

## \UnixFileSystem
jump to top

UnixFileSystem class. This class encapsulates the basic file system functions for platforms using the unix (posix)-stylish filesystem. It wraps php native functions suppressing normal PHP error reporting and instead uses Exception to report and error.

This class is part of a oop based filesystem abstraction and targeted to run on all supported php platforms.

Note: For debugging turn track_errors on in the php.ini. The error messages and log messages from this class will then be clearer because $php_errormsg is passed as part of the message.

FIXME: - Comments - Error handling reduced to min, error are handled by PhingFile mainly

Extends from
  \FileSystem
author
  Andreas Aderhold, andi@binarycloud.com
package
  phing.system.io
version
  $Revision: 1237 $

### Methods

`canDelete( \PhingFile $f ) : boolean`
Whether file can be deleted.
Parameters

Name | Type | Description
--- | --- | ---
$f | \PhingFile |

Returns

Type | Description
--- | ---
boolean |

`compare( $f1, $f2 ) :`
compares file paths lexicographically
Parameters

Name | Type | Description
--- | --- | ---
$f1 |  |
$f2 |  |

`copy( \PhingFile $src, \PhingFile $dest ) : void`
Copy a file, takes care of symbolic links
Parameters

Name | Type | Description
--- | --- | ---
$src | \PhingFile | Source path and name file to copy.
$dest | \PhingFile | Destination path and name of new file.

Details

throws
  if file cannot be copied.

`fromURIPath( $p ) :`
Parameters

Name | Type | Description
--- | --- | ---
$p |  |

`getBooleanAttributes( $f ) :`
Parameters

Name | Type | Description
--- | --- | ---
$f |  |

`getDefaultParent( ) :`
`getPathSeparator( ) :`
returns OS dependant directory separator char
`getSeparator( ) :`
returns OS dependant path separator char
`isAbsolute( $f ) :`
Parameters

Name | Type | Description
--- | --- | ---
$f |  |

`listRoots( ) :`
`lister( $f ) :`
returns the contents of a directory in an array
Parameters

Name | Type | Description
--- | --- | ---
$f |  |

`normalize( $strPathname ) :`
A normal Unix pathname contains no duplicate slashes and does not end with a slash. It may be the empty string.

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.

Parameters

Name | Type | Description
--- | --- | ---
$strPathname |  |

`normalizer( $pathname, $len, $offset ) :`
Normalize the given pathname, whose length is $len, starting at the given $offset; everything before this offset is already normal.
Parameters

Name | Type | Description
--- | --- | ---
$pathname |  |
$len |  |
$offset |  |

`prefixLength( $pathname ) :`
Compute the length of the pathname string's prefix. The pathname string must be in normal form.
Parameters

Name | Type | Description
--- | --- | ---
$pathname |  |

`resolve( $parent, $child ) :`
Resolve the child pathname string against the parent.

Both strings must be in normal form, and the result will be in normal form.

Parameters

Name | Type | Description
--- | --- | ---
$parent |  |
$child |  |

`resolveFile( $f ) :`
the file resolver
Parameters

Name | Type | Description
--- | --- | ---
$f |  |

`setReadOnly( $f ) :`
set file readonly on unix
Parameters

Name | Type | Description
--- | --- | ---
$f |  |

Documentation was generated by DocBlox 0.13.1.