The problem is that you this lock is not mandetory, if you really really want to lock the file, you have to set mendatory lock's. You have to setup a system in which a user will be able to delete/create a file. you can setup semaphore scheme.
Mark ----- Original Message ----- From: "Mkrous" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Tuesday, January 21, 2003 3:59 AM Subject: Re: Upload - File Lock question > Thank you all for your replies, > > >Play around with *FILEHANDLE. For example: > >open FILEHANDLE, ">blah.txt"; > >&closeFile( *FILEHANDLE ); > >sub closeFile { > > my $fh = shift; > > print $fh "I closed you.\n"; > > close $fh; > >} > Still I was not able to delete the file. > > > >you don't need to lock the file when you are deleting > >it. if you lock the file when you are reading / > writing >/ updating it, the deletion of the file > >is block until the lock is released. the locking of > the >file when you are > >trying to deleting it is uneccessary and might create > >dead lock while your > >delete lock is waiting for the r/w/u lock but the > r/w/u >is again waiting > >for the delete lock. does that make sense? if you > have >coded your lock > >correctly when you are reading / writing / updating > the >file, you don't > >have to lock the file when you are deleting it > because >the operation will > >be blocked until your r/w/u lock is released. simply' > >unlink($filePath);' > >should do it. > >david > > I guess that in this case since unlink would not > honour the lock, then it could delete the file anyway, > but what would happen if i delete while a user has not > finished downloading? > > I think of putting the files themselves in the > database > but it does not seem right to me. > Thanks once more for your valuable feedback. > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. > http://mailplus.yahoo.com > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]