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

[REBOL] Re: Encryption

From: joel:neely:fedex at: 8-Sep-2003 10:56

Hi, Matt, IMHO the combination of LINE and BINARY simply isn't meaningful. BINARY means "don't interpret the byte stream, just give it to me as a collection of 8-bit bytes." In contrast, LINE mode asks for a specific set of interpretation rules (and changes!) to be applied to the data. Different environments use different conventions to delimit lines (e.g. newline on *nix, carriage-return on old MacOS, carriage-return-line-feed on CPM) which requires interpreting the bytes to break the file into lines. In LINE mode, REBOL actually looks for any of the above and breaks the input at that point. In non-LINE, non-BINARY mode, REBOL translates any of the above to NEWLINE internally. Write the following data to a file (e.g. %data.raw) #{ 74686973206973206120746573740D0A746865206669727374206C696E652077 61732043524C462C2074686973206F6E65206973204E4C0A616E642074686973 206F6E65206973204352206F6E6C790D746F2073686F77207468652062656861 76696F72206F6620524541442E } and then read it with no refinements, LINE, and BINARY and see how the results differ. As for how to address your specific issue, I'd suggest that you write your own line-parsing if you *really* thing that the idea of LINE is relevant. Then you'll have to decide what to do if #"^/" or #"M" happen to show up in the binary data! ;-) -jn- Matt MacDonald wrote:
> Ok, maybe my inexperience is showing or I'm just dense. I need > to use the line refinement so that I can get the entire line of > the message at once. But you cannot use the binary and line > refinements at the same time. How do I get around this? >
-- ---------------------------------------------------------------------- Joel Neely joelDOTneelyATfedexDOTcom 901-263-4446 Counting lines of code is to software development as counting bricks is to urban development.