Jump to content

[SOLVED] fclose not releasing write lock on Fedora?


IsmAvatar

Recommended Posts

First off, I'm using Fedora, in case that has anything to do with this.

I'm trying to write a log program which will basically repeatedly open a file, write to it, close the file. The problem is, even with the simplest file operations, php doesn't release the write lock on the file.

 

#!/usr/bin/php -q
<?php
$a = fopen('out2.txt','ab');
fclose($a);
?>

when run from the desktop, the result is a file on my desktop with the "write lock" icon on it. The script then terminates, but the lock never goes away.

Anybody know what's up with that?

 

-IsmAvatar

It's probably not a "write lock" on the file, but a permission issue. 

 

Whenever a file is on the desktop that you don't have permissions on, it shows up with a lock (su to root, set the umask to 077 and create a file on the logged in user's desktop...you'll see the same lock on the icon).  Add yourself to the same group as the apache user and make sure the group has read/write permissions.  Or chmod the file (as root) to 777, then see if the lock goes away.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.