Dr. Hawkins wrote:

> On Thu, Mar 26, 2015 at 6:52 PM, J. Landman Gay wrote:
>
>> Is the file opened as a binary file?
>
> For writing, yes.
>
> It isn't opened on read; i just put the url:

Use binary for both.

Writing in text mode (which IIRC is the default in all xTalks except SuperCard) will convert line endings from the internal convention of 0x10 to whatever is appropriate for the host OS.

Reading does the same in reverse.

To preserve data unaltered, use the binary form explicitly, either:

   open file tSomeFilePath for binary read
   read it until EOF
   put it into tData

...or:

   put url ("binfile:"& tSomeFilePath) into tData


Trivia question for Jacque or other HyperCard fans who might now: did reading in HyperTalk also strip NULL bytes, or convert NULLs to spaces? LiveCode doesn't, but I had thought I'd heard that HC did.

--
 Richard Gaskin
 Fourth World Systems
 Software Design and Development for the Desktop, Mobile, and the Web
 ____________________________________________________________________
 [email protected]                http://www.FourthWorld.com

_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to