AXISHK
asked on
use php to lock a directory / files access on LInux
Is it possible to write a small code to lock the file / directory on Linux with PHP ? Tks
Why not use htaccess for this?
ASKER
It is a part of a function on a PHP applications system....
What do you mean by "lock"? Please give more details. Do you want to lock the file from other users locally on the server? or to prevent being accessed from the Internet? or something else?
ASKER
some html pages should be locked temporarily for multi-user access. Need to ensure those copies will not be overrided,... for any reason.
Tks
Tks
Are you writing a CMS? If that is the case, you can force a check in / check out. If somebody wants a page, they click a button or link to get it. You mark a flag in the db that it is being edited and your php code prevents others from seeing any type of edit box. Once the user "checks out" then others can edit. I would put in some type of timer after x minutes to pop up and ask the user if they are still editing though. If no response, release by updating the edit flag in the db.
ASKER
Yes, but the files may be accessed through FTP, not such the PHP application... Tks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
tks