Re: File locking & cron jobs
| From: | jeremy brand | Date: | Fri, 15 Dec 2000 21:15:17 +0000 |
| Subject: | Re: File locking & cron jobs | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-30588@lists.php.net to get a copy of this message | ||
Keep in mind that php's flock() is only valid for php scripts, it does
(AFAIK) no OS or filesystem type locking.
What your are worried about, is a valid concern. You should try and
find another way to do it if you want to be 100% sure about your
solution.
Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more
Get your own Free, Private email at http://www.smackdown.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
At least for the people who send me mail about a new language that
they're designing, the general advice is: do it to learn about
how to write a compiler. --Dennis Ritchie
On Fri, 15 Dec 2000, John Damask wrote:
> Date: Fri, 15 Dec 2000 16:09:29 -0500
> From: John Damask <jbdamask@dotclick.com>
> To: php-general@lists.php.net
> Subject: [PHP] File locking & cron jobs
>
> Hi
> I've got some files on an extranet that are modifiable by certain users.
> A shell script runs as a cron job every 10 mins to copy these files to a
> different web server for general viewing.
> Since the cron job just copies files, do I have to worry about file locking
> in PHP?
> The scenario I'm concerned about is, if php fopen() runs, then the cron job
> picks that file for copy before fputs() or fclose() are called, will there
> be problems?
> I'm hesitant to lock files from PHP - not using flock() but a system that my
> shell script will adhere to as well - because I fear
> user-Internet-connection-anything-can-go-wrong causing lock files to not be
> cleaned up properly.
> thanks
> John
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>