in reply to Re: To learn to search flat files or to cheat...
in thread To learn to search flat files or to cheat...

I actually use CSV for data store that I want to update and query. It offers me a fast way to manually update the file at the same time. Writing a program to run UPDATE TABLE WITH VALUE = 'foo' WHERE KEY = 'bar' when I can just go in with vi and tweak it ... just seems like a win to me ;-)

(Not that I recommend this for all, or even many, uses ... especially live production ones, but you did say "there's not much reason to use them" - I think this one can be significant if it applies.)

Update: perrin is right - I don't do this for CGI scripts, although I do use this in some statically-generated code whose data store isn't updated via code at all. I may move this to be dynamically generated at some point in the future, but the data store will likely remain read-only as far as the web app is concerned.

Replies are listed 'Best First'.
Re^3: To learn to search flat files or to cheat...
by perrin (Chancellor) on Nov 09, 2006 at 23:38 UTC
    You would edit a file with vi that can be modified by a live CGI? That's a recipe for lost data. You have to follow the same rules that the CGI script does for updating it if you want to be safe, i.e. set and respect locks.