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

(singke) #1

print("\n");


// Go back to beginning
rewinddir($myDirectory);


print("\n");
print("Size\n");


// get each entry
while($entryName = readdir($myDirectory))
{
print("<TD ALIGN=\"right\">");
print(filesize($entryName));
print("\n");
}
print("\n");


// close directory
closedir($myDirectory);
print("\n");
?>


boolean rmdir(string directory)


Use the rmdir function to remove a directory. The directory must be empty. To remove a
file, use unlink.


<?
if(rmdir("/tmp/leon"))
{
print("Directory removed");
}
else
{
print("Directory not removed"):
}
?>


set_file_buffer(integer file_handle, integer size)


Use set_file_buffer to set the size of the write buffer on a file stream. It requires a
valid file handle as created by fopen, fsockopen, or popen. The size argument is a
number of bytes, and if you set a buffer size of zero, no buffering will be used. You must
call set_file_buffer before making any reads or writes to the file stream. By default,
file streams start with 8K buffers.

Free download pdf