Re: anyone who REALY knows about file locking?
| From: | Mukul Sabharwal | Date: | Wed, 11 Oct 2000 05:42:53 +0000 |
| Subject: | Re: anyone who REALY knows about file locking? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-19509@lists.php.net to get a copy of this message | ||
check out http://www.devhome.net/tutorials/111000.php
--- Justin French <justin@indent.com.au> wrote: > hi,
>
> i'm after some sample code of correct file locking
> procedures. I'm working on a high traffic site, and
>
> do not want to loose information due to overwriting
> or anything like that, especially if two people try
> and do the same thing at the same time.
>
> what happens when person A accesses the file, has it
>
> locked, and person B tries to open it? does the PHP
> script wait until it's unlocked, or does it return
> an error? is there a timeout? has any one realy
> pushed this stuff, or do we just bang it together &
> hope flock() does a good job?
When A access info.file and is locked by it... and B
tries to open it, it waits until the lock is released
by A ... and yes there can be a timeout too!
>
> What am i after?
>
> - sample code for correct locking procedure which
> covers all my queries above, and any i've missed
>
> - any information / testing results as to what
> happens
> when people try to access a locked file
>
> - any tutorials or anything that realy pushes the
> file locking stuff, making sure i won't get errors
>
> or "file cannot be accessed" stuff when there is
> simultaneous attempts to work with a file.
>
>
> I know that in most cases --and in this case-- that
> the chances of two people writing to a file at the
> same instant is highly unlikely, and that the
> writing
> process could only take half a second or less
> (probably
> appending under 1K to a flat text file), but i think
>
> this is an area where perfection is probably worth a
>
> little effort :)
>
>
> Thanks in advance,
> Justin French
>
> --
> 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
>
=====
To Find Out More About Me : http://mukul.tsx.org/
__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/