php and accessign local files
I am trying to use PHP to access local files.
I have the following code: Code:
<?php Code:
Directory handle: Resource id #4 Entries: .. username . |
It basically is the same thing as a file pointer. i.e. $handle = Resource id #4
http://php.net/manual/en/function.opendir.php |
does that mean it is just pointing to a file? not sure exactly what a file pointer is. why doesn't it just substitute it with the name of the file?
|
Quote:
If you ask why "opendir" command give you a "handle" and not a filename, because file names are inconvenient and unreliable in this situation. For example processes need to pass it to other processes. The string with file name and path can be long and every time it need to be copied byte by byte, first allocating appropriate memory for it. Better is using integer value, which coping is very, very fast for microprocessor. |
All times are GMT -5. The time now is 02:45 PM. |