File System Functions

Function Returns Description
basename(path) String Returns the file name component from a fully qualified path.
chgrp(filename, group) Bool Changes the group of the filename.
chmod(filename, mode) Bool Changes the mode of the filename.
chown(filename, user) Bool Changes the owner of the filename.
clearstatcache() void Clears the state cache.
copy(source, dest) Bool Copies a file from the source to the destination.
dirname(path) String Returns the directory name component from a fully qualified path.
diskfreespace(dir) float Returns the amount of free space in the specified directory.
fclose(fp) Bool Closes a file stream.
feof(fp) Boolean Checks to see if you are at the end of the specified file stream. If you are at the end of the stream feof() will return true, otherwise it will return false.
fgetc(fp) String Reads the next character from the file stream.
fgetcsv(fp, length, [delimiter]) Array Returns an array with the next line separated by commas or a specified delimiter.
fgets(p, length) String Reads a line of up to length-1.
fegetss(fp, length) String Reads a line of up to length-1 while stripping out any HTML tags.
file(filename) Array Reads the entire specified file into an array.
file_exists(filename) Boolean Returns true if the file exists, and false if the file does not exist.
fileatime(filename) Integer Returns the time the file was last accessed.
filectime(filename) Integer Returns the time the file was last changed.
filegroup(filename) Integer Returns the ID of the owner group.
fileinode(filename) Integer Returns the inode number for the file.
filemtime(filename) Integer Returns the time the file was last modified.
fileowner(filename) Integer Returns the ID of the owner of the file.
fileperms(filename) Integer Returns the permissions of the specified file.
filesize(filename) Integer Returns the size in bytes of the file.
filetype(filename) String Returns the type of file.
flock(fp, operation) Boolean Sets or releases a lock on the specified file stream.
fopen(filename, mode) Integer Opens a file in the specified mode.
fpassthru(fp) Integer Outputs data from the current position in the file to the end of the file.
fputs(fp, string, [length]) Integer Writes the specified string to the file stream.
fread(fp, length) String Reads length bytes from the specified file stream.
fseek(fp, offset) Integer Moves the file pointer to offset in the specified file stream.
ftell(fp) Integer Returns the current position of the file pointer.
fwrite(fp, string, [length]) Integer Writes string to the specified file stream.
is_dir(filename) Boolean Checks to see if the specified file is a directory.
is_executable(filename) Boolean Checks to see if the specified file is a executable.
is_file(filename) Boolean Checks to see if the specified file is a file.
is_link(filename) Boolean Checks to see if the specified file is a symbolic link.
is_readable(filename) Boolean Checks to see if the specified file is readable.
is_writable(filename) Boolean Checks to see if the specified file is writable.
link(target, link) Boolean Creates a link.
linkinfo(path) Integer Returns information about the specified link.
lstat(filename) Array Returns information about the specified file.
mkdir(pathname, mode) Boolean Creates a directory with the specified mode.
pclose(fp) Integer Closes a file pointer to a pipe that has been opened with the popen() function.
popen(command, mode) Integer Opens a pipe by using the specified command.
readfile(filename) Integer Reads and outputs the specified file.
readlink(path) String Returns the target of the specified symbolic link.
rename(from, to) Boolean Renames a file from a file name to a file name.
rewind(fp) Boolean Resets the file pointer to the beginning of the specified file stream.
rmdir(path) Boolean Removes the specified directory.
set_file_buffer(fp, buffer) Integer Sets the size of the buffer for the file stream.
stat(filename) Array Returns information about the specified file.
symlink(target, link) Boolean Creates a symbolic link.
tempnam(dir, prefix) String Creates a unique temporary file name in the specified directory.
touch(filename, time) Boolean Sets the modification time of the specified file name.
umask([mask]) Integer Sets PHP’s specific umask and returns the old umask.
unlink(filename) Boolean Deletes the specified file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset