[ Pobierz całość w formacie PDF ] .Ifnis notspecified, dio_read() reads 1K sized block and returns them.dio_seek (PHP 4 >= 4.2.0)Seeks to pos on fd from whenceint dio_seek ( resource fd, int pos, int whence) \linebreakThe function dio_seek() is used to change the file position of the file with descriptorresource.The parameterwhencespecifies how the positionposshould be interpreted:" SEEK_SET - specifies thatposis specified from the beginning of the file" SEEK_CUR - Specifies thatposis a count of characters from the current file position.Thiscount may be positive or negative" SEEK_END - Specifies thatposis a count of characters from the end of the file.A negativecount specifies a position within the current extent of the file; a positive count specifies a positionpast the current end.If you set the position past the current end, and actually write data, you willextend the file with zeros up to that positiondio_stat (PHP 4 >= 4.2.0)Gets stat information about the file descriptor fd455DIO functionsarray dio_stat ( resource fd) \linebreakFunction dio_stat() returns information about the file with file descriptorfd.dio_stat() returns anassociative array with the following keys:" "device" - device" "inode" - inode" "mode" - mode" "nlink" - number of hard links" "uid" - user id" "gid" - group id" "device_type" - device type (if inode device)" "size" - total size in bytes" "blocksize" - blocksize" "blocks" - number of blocks allocated" "atime" - time of last access" "mtime" - time of last modification" "ctime" - time of last changeOn error dio_stat() returns NULL.dio_truncate (PHP 4 >= 4.2.0)Truncates file descriptor fd to offset bytesbool dio_truncate ( resource fd, int offset) \linebreakFunction dio_truncate() causes the file referenced byfdto be truncated to at mostoffsetbytesin size.If the file previously was larger than this size, the extra data is lost.If the file previously wasshorter, it is unspecified whether the file is left unchanged or is extended.In the latter case theextended part reads as zero bytes.Returns 0 on success, otherwise -1.dio_write (PHP 4 >= 4.2.0)Writes data to fd with optional truncation at lengthint dio_write ( resource fd, string data [, int len]) \linebreakThe function dio_write() writes up tolenbytes fromdatato filefd.Iflenis not specified,dio_write() writes alldatato the specified file.dio_write() returns the number of bytes written tofd.456XXIV.Directory functionsWprowadzenieWymaganiaTe funkcje są częścią modułu podstawowego, dlatego są zawsze dostępne.InstalacjaBy używać tych funkcji, nie trzeba niczego instalować.Są one częścią jądra PHP.Konfiguracja startowaTo rozszerzenie nie definiuje żadnych dyrektyw konfiguracyjnych.Typy zasobówPredefiniowane stałeTo rozszerzenie nie definiuje żadnych stałych.Zobacz równieżFor related functions such as dirname(), is_dir(), mkdir(), and rmdir(), see the Filesystem section.457Directorieschdir (PHP 3, PHP 4 )change directorybool chdir ( string directory) \linebreakChanges PHP s current directory todirectory.ReturnsFALSEif unable to change directory,TRUEotherwise.See also getcwd().chroot (PHP 4 >= 4.5)change the root directorybool chroot ( string directory) \linebreakChanges the root directory of the current process todirectory.ReturnsFALSEif unable tochange the root directory,TRUEotherwise.Notatka: It s not wise to use this function when running in a webserver environment, because it snot possible to reset the root directory to / again at the end of the request.This function will onlyfunction correct when running as CGI this way.Notatka: Ta funkcja nie jest dostępna na platformie Windows.dir (PHP 3, PHP 4 )directory classclass dir {dir(string directory);string path;string read();void rewind();void close();}A pseudo-object oriented mechanism for reading a directory.The givendirectory is opened.Two properties are available once the directory has been opened.The handle property can be usedwith other directory functions such as readdir(), rewinddir() and closedir().The path property is setto path the directory that was opened.Three methods are available: read, rewind and close.Please note the fashion in which dir() s return value is checked in the example below.We areexplicitly testing whether the return value is identical to (equal to and of the same type as--seeComparison Operators for more information)FALSEsince otherwise, any directory entry whosename evaluates toFALSEwill stop the loop.458DirectoriesPrzykład 1.dir() example$d = dir("/etc");echo "Handle: ".$d->handle."\n";echo "Path: ".$d->path."\n";while (false !== ($entry = $d->read())) {echo $entry."\n";}$d->close();Notatka: The order in which directory entries are returned by the read method issystem-dependent.Notatka: This defines the internal class Directory, meaning that you will not be able to defineyour own classes with that name.For a full list of predefined classes in PHP, please seePredefined Classes.closedir (PHP 3, PHP 4 )close directory handlevoid closedir ( resource dir_handle) \linebreakCloses the directory stream indicated bydir_handle.The stream must have previously beenopened by opendir().getcwd (PHP 4 )gets the current working directorystring getcwd ( void) \linebreakReturns the current working directory.See also chdir().opendir (PHP 3, PHP 4 )open directory handle459Directoriesresource opendir ( string path) \linebreakReturns a directory handle to be used in subsequent closedir(), readdir(), and rewinddir() calls.Ifpathis not a valid directory or the directory can not be opened due to permission restrictions orfilesystem errors, opendir() returnsFALSEand generates a PHP error.You can suppress the erroroutput of opendir() by prepending @ to the front of the function name.Przykład 1.opendir() exampleSee also is_dir().readdir (PHP 3, PHP 4 )read entry from directory handlestring readdir ( resource dir_handle) \linebreakReturns the filename of the next file from the directory.The filenames are returned in the order inwhich they are stored by the filesystem.Please note the fashion in which readdir() s return value is checked in the examples below.We areexplicitly testing whether the return value is identical to (equal to and of the same type as--seeComparison Operators for more information)FALSEsince otherwise, any directory entry whosename evaluates toFALSEwill stop the loop.Przykład 1.List all files in a directory// Note that !== did not exist until 4.0-RC2Note that readdir() will return the.and.entries.If you don t want these, simply strip them out:Przykład 2.List all files in the current directory and strip out.and.See also is_dir().rewinddir (PHP 3, PHP 4 )rewind directory handlevoid rewinddir ( resource dir_handle) \linebreakResets the directory stream indicated bydir_handleto the beginning of the directory.461XXV.DOM XML functionsWprowadzenieOstrzeżenieTen moduł jest w stadium EKSPERYMENTALNYM.Oznacza to, żezachowanie tych funkcji, ich nazwy, w zasadzie wszystko udokumentowanetutaj może zostać zmienione w przyszłych wersjach PHP bez wcześniejszegouprzedzenia.Używaj tego modułu na własne ryzyko.The domxml extension has been overhauled in PHP 4.3.0 to provide a better compliance with theDOM standard.The extension still contains many old functions, but they should not be usedanymore.Especially those non object oriented functions should be avoided.The extension allows you to operate on an XML document with the DOM API.It also provides afunction domxml_xmltree() to turn the complete XML document into a tree of PHP objects.Currently this tree should be considered read-only - you can modify it but this would not make anysense since DomDocument_dump_mem() cannot be applied to it
[ Pobierz całość w formacie PDF ]
zanotowane.pldoc.pisz.plpdf.pisz.plhanula1950.keep.pl
|