flock

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

flock

Post by shiznatix »

im having trouble with locking text files. this always sends me 'couldnt lock it g'. any idea why? i have php 4.3

Code: Select all

$open = fopen('shiznatix.txt', 'w');
if (flock($open, LOCK_SH)){ 
echo 'success lock'; print_r($file_arr); 
}else{ 
echo 'couldnt lock it g';
}
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

what OS is this being run on?
flock() wrote:flock() is not supported on antiquated filesystems like FAT and its derivates and will therefore always return FALSE under this environments (this is especially true for Windows 98 users).
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

linux apache server
Post Reply