File operations have always been a headache for Web programmers, and file operations are necessary in systems like CMS. Nowadays, the function content for PHP file operations is very powerful, and this part of the file is also an important part of
Basic custom C _ init _ (self [, arg1,]) constructor (with some optional parameters) C _ new _ (self [, arg1,]) constructor (with some optional parameters); basic customization type
C. init (self [, arg1,...]) constructor (with some optional
Basic custom C _ init _ (self [, arg1,]) constructor (with some optional parameters) C _ new _ (self [, arg1,]) constructor (with some optional parameters); basic customization type
C. _ init _ (self [, arg1,...]) constructor (with some optional
The background is this: the site at the beginning of a smaller number of visits, people will all the picture files uploaded to a directory (such as/data/images/). Later visits were large, and there were many pictures, which affected the efficiency
1.Linux Operating SystemMulti-user2.shellCommand line interpreter consumer coreInterpreted type rather than compiledRun Program Fork Child process EXECV function cluster Replace user-specified program wait process end3.vim, gcc/g++ (using dynamic
InodeIn Linux, all files are stored in file form.For a file, it has two properties, one is its own property, also known as the metadata of the file, indicating the properties of the file itself, such as who the creator of the file, which group is,
In PHP file operation is nothing more than a file read and write operations, delete operations, judgment operations, permissions operations and some file search, and so on, I will learn the PHP file operation function for everyone to post it.
File
First, Inode node understandingInode (Index node): The area where file meta information is storedSector: In Linux systems, the smallest unit of storage, typically 512 bytes (0.5KB)Block:linux the smallest access area in the system (when the
One: Directory operations
The first introduction is a function read from the directory, Opendir (), Readdir (), Closedir (), using the file handle is opened first, and then the iteration is listed:
Copy CodeThe code is as follows:
$base _dir =
I. Directory operationsFirst, we will introduce a function that reads data from a directory, such as opendir (), readdir (), and closedir (). When using this function, we will first open the file handle and then list it through iteration:
$
ArticleDirectory
Install on Linux
Install on Windows
Obtain mono
Currently, you can obtain the mono software package in the following four ways.
•ToMonoDownload the release version of the installation package from the official
First, directory operations
The first is the function that reads from the directory, Opendir (), Readdir (), Closedir (), which is used when the file handle is opened, and then the iteration is listed:
Copy CodeThe code is as follows:
$base _dir= "
Copy CodeThe code is as follows:
Common file manipulation functions
The first part of the file read and write and create delete rename, etc.
Before you start working on a file, let's see if it's a file file that can be read and writable.
$file =
PHP Gets the file attributes last modified time:
? PHP
$ file ' test.txt ';
Filemtime ($file));
?>
Returns a timestamp that says Unix, which is commonly used in caching techniques.
The relevant PHP gets
About PHP
Clearstatcache-Clear the File status cache below we have explained, there are specific examples oh.
Clearstatcache(PHP 4, PHP 5)Clearstatcache-Clears the file state cacheDescribeInvalid Clearstatcache ([Boolean $ clear_realpath_cache =
First, Introduction
In any computer device, files are all necessary objects, and in Web programming, the operation of the file has always been a headache for web programmers, and, the operation of the file in the CMS system is a must, very useful,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.