Writing to files
Posted: Sat Jan 02, 2010 7:55 pm
I'm converting what was originally a HC stack, then an SC stack into what I would like to be a Revolution project.
Basically, it creates a series of files containing HTML code, using data stored in cards.
I end up with a dozen or so pages of HTML, each page saved as a separate disk file for FTP-ing to a server. It's worked this way for 15 years or so.
Now with the conversion to Revolution well on its way, I notice that the disk files do not get rewritten when I run the relevant script. Instead, if the new page is shorter, then part of the old page is left tagged on at the end, creating all sorts of HTML errors, of course.
The files are closed correctly in the scripts, so I assume that Revolution handles files differently to HC and SC (where the files have always reflected only the current situation and all previous information is "overwritten"). It looks as if, if the new data is shorter than that in the previous file, the EOF is left at the end of the old data, instead of being positioned at the end of the new data. Does this mean that I must somehow delete the files completely before writing to them?
I'm using RevMedia 4.0.
Any help would be appreciated.
Basically, it creates a series of files containing HTML code, using data stored in cards.
I end up with a dozen or so pages of HTML, each page saved as a separate disk file for FTP-ing to a server. It's worked this way for 15 years or so.
Now with the conversion to Revolution well on its way, I notice that the disk files do not get rewritten when I run the relevant script. Instead, if the new page is shorter, then part of the old page is left tagged on at the end, creating all sorts of HTML errors, of course.
The files are closed correctly in the scripts, so I assume that Revolution handles files differently to HC and SC (where the files have always reflected only the current situation and all previous information is "overwritten"). It looks as if, if the new data is shorter than that in the previous file, the EOF is left at the end of the old data, instead of being positioned at the end of the new data. Does this mean that I must somehow delete the files completely before writing to them?
I'm using RevMedia 4.0.
Any help would be appreciated.