Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Binary Troubles

Status
Not open for further replies.

sleuth

Programmer
Jan 12, 2001
134
US
Ok, I'm working on a program which handles a lot of binary data,

Now, do some gif , jpg, or bmp files need returns (\r)?

I'm taking them out and it seems only files that are in one line are showing up properly in my program.

I'm also doing this on windows.

Thanks,

Tony "Java?? Umm, I think that's the stuff I drink while I'm coding perl."
 

Figured it out, zee answer is yes,

Tony "Java?? Umm, I think that's the stuff I drink while I'm coding perl."
 
I don't understand... how are you reading in these files, and when do they get mangled up?

I've found that you need to do a binmode() on a filehandle when writing a binary file in Win32 perl. Is this related to what yer talking about?

-k
 

Yes, I did have to use binmode but what I didn't understand at the time was why it still wasn't working when I'd write the file back after displaying it in a text field, when I placed the binary data into the text field being windows and all it added \r returns to every \n.

So when I wrote it back to the file it came from it was not displaying properly becuase I had to take out the returns again.

Tony "Java?? Umm, I think that's the stuff I drink while I'm coding perl."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top