Ask a Question related to PHP Development, Design and Development.
-
Cameron #1
File Operations
I am writing a project in PHP for Unix based systems and may need to
store data in files as apposed to an SQL server, I know there are many
problems that can arise out of using files in this way especially when
multiple users are concerned and would prefer not to use them at all,
but if I have to I could do with some suggestions about the best way to
avoid trashed files due to simultaneous writes.
I am aware of the flock() function and ignore_user_abort() but aren't
sure of the best way to implement them, and I also hear that
ignore_user_abort() doesn't work when PHP is running in safe mode.
Thanks for any help you can give.
~Cameron
Cameron Guest
-
File Operations and System Calls in Perl (WAS: some doubt)
Okay, I'll give you a few pointers, but first, please use a more descriptive subject line and start a new message when you start a new thread. ... -
#26375 [NEW]: Circumventing safe mode to extend file operations
From: php-online at cyberblue dot org dot uk Operating system: MacOS/Redhat PHP version: 4.3.3 PHP Bug Type: Feature/Change... -
advice on file operations
My project shows QuickTime short movies of people being interviewed. Its going to be on DVD but I need to store information such as, bookmarked... -
Why two POST Operations?
Hello, This is perhaps a bit of a newbie question, but I am using the Apache Axis tcpmon program to inspect xml-based web services messages with... -
Database Operations
After creating a data source to a database in DMX is it possible to create database tables, add/edit table fields, etc. -
Jerry Sievers #2
Re: File Operations
Cameron <devnull@foo-bar.invalid> writes:
I haven't used flock in a while as I too go RDBMS whenever possible.> I am writing a project in PHP for Unix based systems and may need to
> store data in files as apposed to an SQL server, I know there are many
> problems that can arise out of using files in this way especially when
> multiple users are concerned and would prefer not to use them at all,
> but if I have to I could do with some suggestions about the best way to
> avoid trashed files due to simultaneous writes.
>
> I am aware of the flock() function and ignore_user_abort() but aren't
However, flock is usually adequate to avoid multiple file access. Use
it in a similar way as a DB transaction block.
open file
exclusive lock (you can either block here or spinn and retry)
read file
write file
release lock
close file
HTH
--
-------------------------------------------------------------------------------
Jerry Sievers 305 854-3001 (home) WWW ECommerce Consultant
305 321-1144 (mobile [url]http://www.JerrySievers.com/[/url]
Jerry Sievers Guest



Reply With Quote

