[REBOL] Re: [port/skip]

2004-05-30 Thread Carl Read

 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

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: [port/skip]

2004-05-29 Thread Carl Read

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 10

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

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
 
-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.



[REBOL] Re: [port/skip]

2004-05-29 Thread Arie van Wingerden

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 [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
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 10

 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

 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
 
 -- 
 To unsubscribe from this list, just send an email to
 [EMAIL PROTECTED] with unsubscribe as the subject.
 
 

 -- 
 To unsubscribe from this list, just send an email to
 [EMAIL PROTECTED] with unsubscribe as the subject.

-- 
To unsubscribe from this list, just send an email to
[EMAIL PROTECTED] with unsubscribe as the subject.