PHP File System processing
All file processing is done using system functions.
PHP file processing is based on the Linux/unix system as a model, under Linux completely no problem
There are some differences under Windows.
# # # File read and write operations, and C language and other processing methods.
The role of file processing:
1. All projects are inseparable from file processing.
2. Keeping the data for a long time requires documentation
3. Create a file operation in the website cache/server
File processing:
1. Use the system function to get the file type, etc.
# # # Types of files
# # # File system types
With the model of the Linux/unix Commission,
Only File,dir or unknown types can be obtained in Windows (three kinds)
Under Linux Block,char, dir, FIFO, file, link, unknown (seven kinds)
Blocks: Block device files, one disk partition, floppy drive, optical drive, etc.
Char: Character device, output process I/O device, keyboard, printer, etc.
*dir: Directory is also a kind of file, Linux usually file, type is different,
*fifo: Command pipeline, information passed from one process to another
File
Link: Linked file, (shortcut) ln-s
FileType ("directory or file name")
Is_file--Determine if the given file name is a normal file
Is_dir--Determine if a given file name is a directory
Is_executable--Determine if the given file name is executable
Is_link--Determine if the given file name is a symbolic connection
Is_readable--to determine if a given file name is readable
Is_uploaded_file--Determine if the file was uploaded via HTTP POST
Is_writable--Determines whether a given file name can be written
Is_writeable--alias of Is_writable ()
2. File attribute acquisition
File_exists--Check whether a file or directory exists
FileSize--Get file size
Is_readable--to determine if a given file name is readable
Is_writable--Determines whether a given file name can be written
Fileatime--Get the last access time of the file
Filemtime--Get File modification time
Filectime--Get the Inode modification time of the file
Fileactime ()--access. Modification Time
State--View file status
3. Get the file location * (Directory related functions)
4. File operation (Create delete move)
5. File open Close (read file contents, write content to file)
6. Move the pointer inside the file (read the data at the specified location in the file, read only the middle characters ...)
7. File Locking mechanism
can use the mouse to complete, can be completed with the program (* * operation of the object on the remote host *)
Directory processing
1. Traversal of the Directory
2. Creation and deletion of directories
3. Replication of directories
There are system functions for the file, * * * directory is not
5. Statistics Directory Size
File Upload and download
1. Upload
2. Download
Notes PHP File System processing