Fopen question? -Php Tutorial

Source: Internet
Author: User
Fopen question? $ File = '/data0/htdocs/www.25229.com/data/block/687-accept_service-order_str.data ';
$ Mod = 'A + ';
If (! $ Fp = fopen ($ file, $ mod )){
Echo '1 ';
} Else {
Echo '2 ';
}

Fopen: failed to open stream: No space left on device is reported. if you change the file name, No error is reported. you can create a file and create a file directly on the server. the same error is reported, for example: if you change it to "687-accept_service-order_str.data1", no error is reported. there is still much space on the hard disk.
There is no problem with the number of directories in the partition. the partition format is ext4.

Why is there no problem with changing the file name? a headache !!!


Reply to discussion (solution)

Is it a character issue?
Try again in the Spanish state

No problem. you can create a file for the directory. the file named "/data0/htdocs/www.25229.com/data/block/" cannot be created,

Tested with your code. everything works normally and output 2.

Since other file names can be changed, it is impossible that there is not enough space.

Try changing $ mod = 'A + '; to r and try to read it.

No. only the directory "block" cannot create files. there is no problem in other directories, but change the file name in this directory,
Actually, this file does not exist. it does not work if you directly use the command line to create a file on the server. it does not seem to be related to the program, but you do not know why this name cannot be created in this directory, in other directories, this directory contains 7718686 files, but does not exceed the partition limit "inodes ".

There are 20 thousand small files. it cannot be ruled out that your file cannot be a + due to damage.

Rm/data0/htdocs/www.25229.com/data/block/687-accept_service-order_str.data
Rm: cannot remove '/data0/htdocs/www.25229.com/data/block/687-accept_service-order_str.data': No such file or directory
The file does not exist,
When No space left on device is displayed in touch/data0/htdocs/www.25229.com/data/block/687-accept_service-order_str.data

But other files can be created in this directory, as long as the names are different.

In fact, this is a typical manifestation of corrupted file directory information.
Each file has an item in the directory file, marking the location of the file on the hard disk, the number of sectors occupied, and other management information.
As long as one of the bytes is corrupted, various problems may occur.
You can copy the entire directory to the new directory and delete the original directory. you may find that the directory cannot be deleted. In this case, it is very troublesome. a simple solution is to delete all the items that can be deleted. Use the new directory instead. If you have a file shredder, try again.
Of course it would be better to delete the directory. you can simply change the name of the copied directory.

Deleting a directory will affect the use of the website. all the data on the website is in it.
In addition, this directory automatically loses files. as long as the files are lost, they cannot be created again. only this directory will

Yes, deletion may have some impact, but didn't you tell me to copy it?
Make an announcement when the traffic is low. It won't have much impact.

The directory will lose the file, indicating that the directory contains too many files and too many fragments. It may also be caused by the aging of the track.
In short, it is helpful to change the directory on the hard disk.
There are too many files to solve, which may involve program modifications. you can put them first.

It should be a directory problem. I can mount -- bind a new directory directly. thank you.

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.