Re: disk files
- Posted by JJProg at CYBERBURY.NET Dec 30, 1999
- 501 views
EU>Hey all, about disk files, i understand that when one is opened, Eu loads it EU>into memory(?) and then when closed it flushes it back out(?), my question EU>is this: if i open it for reading, then decide to append to it, i must close EU>it as "r" then reopen it as "a", write to it, then close it as "a" and EU>reopen it as "r" to continue the application,, can things be speeded up some EU>if the file is not flushed to disk as often, or only on a flush command? I EU>realize a flush command may make some files outdated as they are changed by EU>a running app and not written to disk, i ran into that problem with all disk EU>caches tho, and can deal with it. Or is the only solution to read the file EU>into on huge sequence and not write it out until the program ends? What if EU>it's a 48Meg file (i have a 48Meg text file), which will take 192Meg as a Eu EU>sequence, and i have only 96Meg of ram? I hear someone saying make all EU>writes a separate file, appending them at the end of application run, but EU>that won't make them part of the file as i am reading it, which it must be. EU>It's now about 3pm, Eu has been running since midnite munging a 136Meg EU>series of files, reading and appending to a file which has grown to 800K so EU>far after munging only 1/2 the 136Meg, extrapolating from that, if i munge EU>the 1.6Gig KB, i'll get a 18Meg disk file or a 75Meg sequence, which won't EU>fit into memory,,, so i stick to disk files and am limited by the speed of EU>open/close operations? EU>Kat I don't think Euphoria loads the file into memory. Files are usually buffered by the operating system, and usually only parts of them are in memory at a time. You may still need to close your file before opening it for append, but you don't need to worry about the entire file being in memory. Also, disk caches would be stored in byte arrays, not Euphoria sequences. Jeffrey Fielding JJProg at cyberbury.net http://members.tripod.com/~JJProg/