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

[port/skip]

 [1/6] from: carl::cybercraft::co::nz at: 29-May-2004 22:02


Are there any known problems with the use of skip with ports? As on files it doesn't seem to work for me...
>> write %test.txt "abcdefghijkl" >> port: open/direct/binary %test.txt >> copy/part port 4
== #{61626364}
>> close port >> port: open/direct/binary/skip %test.txt 4 >> copy/part port 4
== #{61626364}
>> close port
but does with URLs...
>> port: open/direct/binary http://www.rebol.com/
connecting to: www.rebol.com
>> copy/part port 4
== #{3C48544D}
>> close port >> port: open/direct/binary/skip http://www.rebol.com/ 4
connecting to: www.rebol.com
>> copy/part port 4
== #{4C3E0A3C}
>> close port
And if I use skip on an already opened port, ie... port: skip port 4 it'll work if it's a file, but if an URL it'll just hang with nothing returned. Easy enough to work around this behaviour with files, but does skip with URLs only work when opening the port? Or am I doing something wrong? -- Carl Read

 [2/6] from: carl:cybercraft at: 29-May-2004 23:13


Hmm - I was badly wrong about skipping files after an open working okay - REBOL totally locks up when I attempt this kind of thing... (Taken from the Users' Guide: http://www.rebol.com/docs/core23/rebolcore-14.html#section-8.4)... fp: open/direct/binary %file.dat fp: skip fp 100000 My example...
>> write %test.txt "abcdefghijkl" >> fp: open/direct/binary %test.txt >> fp: skip fp 4
At that point it totally locks up. Esc's no use - have to use Ctrl/Alt/Delete to shut REBOL down. Using Win98SE. Is it the same for other Windows users? -- Carl Read

 [3/6] from: apwing:zonnet:nl at: 29-May-2004 14:41


Hi Carl, indeed I experience exactly the same phenomenon! CPU goes to 100% and I have to kill REBOL because it's stuck somewhere. I'm running Win2k with all service packs / updates applied and REBOL/View 1.2.46.3.1. Met vriendelijke groet / with kind regards, Arie van Wingerden http://home.zonnet.nl/rebolution/ ----- Original Message ----- From: "Carl Read" <[carl--cybercraft--co--nz]> To: <[rebol-list--rebol--com]> Sent: Saturday, May 29, 2004 1:13 PM Subject: [REBOL] Re: [port/skip]
> Hmm - I was badly wrong about skipping files after an open working okay -
REBOL totally locks up when I attempt this kind of thing... (Taken from the Users' Guide: http://www.rebol.com/docs/core23/rebolcore-14.html#section-8.4)...
> fp: open/direct/binary %file.dat > fp: skip fp 100000
<<quoted lines omitted: 3>>
> >> fp: skip fp 4 > At that point it totally locks up. Esc's no use - have to use
Ctrl/Alt/Delete to shut REBOL down. Using Win98SE. Is it the same for other Windows users?

 [4/6] from: atruter:labyrinth:au at: 29-May-2004 23:10


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

 [5/6] from: carl:cybercraft at: 30-May-2004 21:15


> From Tracker#295 ><SNIP>
<<quoted lines omitted: 7>>
>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

 [6/6] from: apwing:zonnet:nl at: 29-May-2004 14:41


Hi Carl, indeed I experience exactly the same phenomenon! CPU goes to 100% and I have to kill REBOL because it's stuck somewhere. I'm running Win2k with all service packs / updates applied and REBOL/View 1.2.46.3.1. Met vriendelijke groet / with kind regards, Arie van Wingerden http://home.zonnet.nl/rebolution/ ----- Original Message ----- From: "Carl Read" <[carl--cybercraft--co--nz]> To: <[rebol-list--rebol--com]> Sent: Saturday, May 29, 2004 1:13 PM Subject: [REBOL] Re: [port/skip]
> Hmm - I was badly wrong about skipping files after an open working okay -
REBOL totally locks up when I attempt this kind of thing... (Taken from the Users' Guide: http://www.rebol.com/docs/core23/rebolcore-14.html#section-8.4)...
> fp: open/direct/binary %file.dat > fp: skip fp 100000
<<quoted lines omitted: 3>>
> >> fp: skip fp 4 > At that point it totally locks up. Esc's no use - have to use
Ctrl/Alt/Delete to shut REBOL down. Using Win98SE. Is it the same for other Windows users?

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted