Lost Friday!!!



Related Entries

alse; if ( ! $recursive ) return @chown($file, $owner); if ( ! $this->is_dir($file) ) return @chown($file, $owner); // Is a directory, and we want recursive $filelist = $this->dirlist($file); foreach ($filelist as $filename) { $this->chown($file . '/' . $filename, $owner, $recursive); } return true; } /** * Gets file owner * * @param string $file Path to the file. * @return string|bool Username of the user or false on error. */ function owner($file) { $owneruid = @fileowner($file); if ( ! $owneruid ) return false; if ( ! function_exists('posix_getpwuid') ) return $owneruid; $ownerarray = posix_getpwuid($owneruid); return $ownerarray['name']; } /** * Gets file permissions * * FIXME does not handle errors in fileperms() * * @param string $file Path to the file. * @return string Mode of the file (last 4 digits). */ function getchmod($file) { return substr(decoct(@fileperms($file)),3); } function group($file) { $gid = @filegroup($file); if ( ! $gid ) return false; if ( ! function_exists('posix_getgrgid') ) return $gid; $grouparray = posix_getgrgid($gid); return $grouparray['name']; } function copy($source, $destination, $overwrite = false, $mode = false) { if ( ! $overwrite && $this->exists($destination) ) return false; $rtval = copy($source, $destination); if ( $mode ) $this->chmod($destination, $mode); return $rtval; } function move($source, $destination, $overwrite = false) { if ( ! $overwrite && $this->exists($destination) ) return false; // try using rename first. if that fails (for example, source is read only) try copy if ( @rename($source, $destination) ) return true; if ( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ) { $this->delete($source); return true; } else { return false; } } function delete($file, $recursive = false, $type = false) { if ( empty( $file ) ) /

Random Pics



Share this with a friend

Your Name
Your Email
Friends Emails (at least 1)
Confirm email
1
2
3
4
5
  


Subscribe for more Fun

Receive best fun forwards in your inbox.

Confirm email
Your Email



Add Your Comments

comments powered by Disqus