Reading/Deleting Last Line Of File

J. Landman Gay jacque at hyperactivesw.com
Sat Feb 13 00:20:41 EST 2010


Kay C Lan wrote:
> On Sat, Feb 13, 2010 at 8:25 AM, Alex Tweedly <alex at tweedly.net> wrote:
> 
>> Could you try this in your multi-line msg box and let me know what it does
>> on Mac ?
>>> put "abcdefg" & CR into URL "file:b.txt"
>>> put URL "file:b.txt"
>>> open file "b.txt" for append
>>> write "x" to file "b.txt"  at 2
>>> close file "b.txt"
>>> put URL "file:b.txt" after msg
>> on Win, it produces
>>> abcdefg
>>> abx
> Alex,
> 
> on OS X.6.2, MBP, Rev 4.0
> 
> abcdefg
> abcdefg
> x

I get what Kay got on OS X 10.5.8, which is the correct behavior. Append 
is supposed to force any writes to the end of the existing file. I 
tested some more with the "open for write" command, which should do what 
Alex was after -- truncating the text at the character offset, and 
adding any new data at that position. This fails on both Windows and Mac.

Bug report has been submitted. For details, see:
<http://quality.runrev.com/qacenter/show_bug.cgi?id=8614>

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list