PHP file path and operation permissions (top)

Source: Internet
Author: User
Tags file copy http post

Let's take a look at the role of the file processing system (o?▽?) O

1. All projects can not be separated from document processing

2. You can save data for a long time with a file

3. Setting up the cache, file operations on the server

I. Types of files

With Linux as a model, only three types of file, dir, unknown are available under Windows

Under Linux/unix, you can get block, char, dir, FIFO, file, link, unknown type

  Determine some of the functions of the directory? (?????)?

Is_dir--Determine if the file is a directory

Is_executable--Determine if the file is executable

Is_file--Determine if the file is a normal file

Is_link--Determine if the file is a symbolic connection

Is_readable--Determine if the file is readable

Is_writable--Determine if the file is writable

Is_writeable--alias of Is_writable ()

Is_uploaded_file--Determine if the file was uploaded via HTTP POST

Ii. Properties of the file

1.file_exists (); --Determine if the file exists

2.filesize (); --Get File size

3.is_readable (); --Determine if the file is readable

4.is_writeable (); --Determine if the file is writable

5.filectime (); --Get the file creation time

6.filemtime (); --Get the last time the file was modified

7.fileactime (); --Get file last access time

Third, and file path-related functions

  Relative path: Compared to the ancestor and subordinate directories of the current directory

. Current directory: Parent Directory

Path delimiter: Under Linx/unix with "\" under "/" Windows. but no matter what the operating system, in PHP support "/"

  Absolute path:/root Path

If the path is executed in the server (via PHP file handler), then "root" refers to the root of the operating system.

  If the program is a downloaded client, and then access the files on the server, only through Apache access, "root" also refers to the document root directory

Iv. functions related to the operation of the file

Create a file Touch ("file name")

Delete File unlink ("File name")

Move the file, rename the file rename ("Current file path", "Destination file path")

Copy the file copy ("Current file path", "Destination file path")

  Functions related to permission design (' contest ')

_RWXRWXRWX 777

The first rwx represents the owner of this file R read W write X executed

The second rwx indicates that the owner of this file is located in the group R Read W write X executes

The third rwx represents the rights of other users to the file R read W write X Execute

A rwx of 7 4+2+1

For example: 644 is 4+2, 4, 4

Rw_ r__ r__

CHGRP--Change the group to which the file belongs

chmod--Changing the file mode

Chown--Change the owner of the file

Filegroup--The group that gets the file

Fileowner--Get the owner of the file

PHP file path and Operation permissions (UP)

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.