File Operation-php

Source: Internet
Author: User

<?php
/*
Building a cache
You can save data for a long time with a file
The file is a liunux model.
You can only get file under Windows, dir unknow
Block char dir file link unknown can be obtained under Linux
Blocks: Block set file partition, floppy disk drive, CD-ROM, etc.
Char: Character device I/O in characters, keyboard, printer
Dir: The directory is also a file
Fifo:
FileType ("file name"); Generally, save file types
Is_array ()
Is_file ()
Is_dir--Determine if a given file name is a directory
Is_executable--Determine if the given file name is executable
Is_file--Determine if the given file name is a normal file
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 ()
Fileatime--Get the last access time of the file
Filectime--Get the Inode modification time of the file
Filegroup--The group that gets the file
Fileinode--Get the inode for the file
Filemtime--Get File modification time
Fileowner--Get the owner of the file
Fileperms--Permission to get files
FileSize--Get file size
FileType--Get file type
*/
/* echo filetype (".. /work_php ");
if (filetype ("./zhengze.php") = = "File")
echo "This is a file"; */

function Getfiletype ($filename) {
if (file_exists ($filename))
{
echo "file or directory {$filename} exists". " <br> ";
}
if (Is_dir ($filename)) {
echo "This is a directory!" "." <br> ";
}
if (is_readable ($filename)) {
echo "This is a readable file!". <br> ";
}
if (is_writeable ($filename)) {
echo "This is a file that can be written!". <br> ";
}
if (is_executable ($filename)) {
echo "This is a file that can be executed";
}
}
Getfiletype ("./zhengze.php");
?>

File Operation-php

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.