Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: [port/skip]

From: carl:cybercraft at: 30-May-2004 21:15

> From Tracker#295 > ><SNIP> >[skip does not work with open/binary/direct] > >file: open/binary/direct/skip does not work. >at file n does not work >skip file n causes REBOL to hang. > >These operations should either work or not be allowed on files opened with >/direct. ></SNIP> > >Regards, > > Ashley
Ah - good they know about it. In the meantime, this is my work-around: First, what happens if you use append...
>> write %test.txt "12345" >> x: open/binary/direct %test.txt >> append x to-binary "abc" >> close x >> read %test.txt
== "abc45" And my solution using loop and copy...
>> write %test.txt "12345" >> x: open/binary/direct %test.txt >> loop size? %test.txt [copy/part x 1]
== #{35}
>> append x to-binary "abc" >> close x >> read %test.txt
== "12345abc" And given this behaviour, you may as well use insert instead of append. Also, would copying larger blocks of bytes instead of just one at a time be faster or better? Thanks for all the responses, -- Carl Read