Microsoft Word - Core PHP Programming Using PHP to Build Dynamic Web Sites

(singke) #1

print("$filename is readable");
}
else
{
print("$filename is not readable");
}
?>


boolean is_writeable(string filename)


The is_writeable function returns true if a file exists and is writeable; otherwise it
returns false. Similar functions are is_executable and is_readable.


<?
$filename = "data.txt";


if(is_writeable($filename))
{
print("$filename is writeable");
}
else
{
print("$filename is not writeable");
}
?>


boolean link(string source, string destination)


The link function creates a hard link. A hard link may not point to a directory, may not
point outside its own filesystem, and is indistinguishable from the file to which it links.
See the man page for link or ln for a full description. The link function expects a
source file and a destination file. On Windows this function does nothing and returns
nothing. You can create a symbolic link with the symlink function.


<?
link("/www/htdocs/index.php", "/www/htdocs/index2.php");
?>


integer linkinfo(string filename)


The linkinfo function calls the C function lstat for the given filename and returns the
st_dev field lstat generates. This may be used to verify the existence of a link. It
returns false on error. You can read more about lstat on the man page, or in the help
file for Microsoft Visual C++.

Free download pdf