Re: Updating a single line in a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Curt Zirzow" <czirzow@xxxxxxxxx> a écrit dans le message de news: 
20060318190754.GA95217@xxxxxxxxxxxxxxx
> On Sat, Mar 18, 2006 at 11:01:07AM +0100, smr78 wrote:
>> Hi,
>> What is the best method to update a single line in a text file?
>> I have a file made of identifiers, that is pointed on by a htaccess file 
>> and
>> used by a server to give access to a web site.
>> The file content is like this :
>> login1:pass1\r\n
>> login2:pass2\r\n
>> ....
>> loginn:passn\r\n
>> loginn1:passn1\r\n
>> ....
>> lastlogin:lastpass\r\n
>
> Why dont you use a database for this?  You will run into race
> conditions at some point.
>
> If you need a file based database take a look at sqlite.
>
> Curt.
> -- 
About the race conditions, I didn't mentionned I had some extras code to 
care about concurrent writing on the file
About database, I know that will be the best, but on this small site, I 
can't use full database!
Thank you for your answer
SR 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux