windows to linux pickled objects?

kosh at aesaeion.com kosh at aesaeion.com
Wed Nov 28 08:36:15 EST 2001


On Wed, 28 Nov 2001, Stephen Boulet wrote:

> Thanks to you both for the responses.
>
> But is writing in binary mode supported under linux? The tutorial says:
>
> <<
> On Windows and the Macintosh, 'b' appended to the mode opens the file in
> binary mode
> >>
>
> I tried it on linux and the program did run, but the size of the pickled
> file only went down from 8183905 bytes to 8180057 bytes, and the file
> wasn't binary at all. Maybe the size difference can be explained by the
> lack of carriage returns.  ;)
>
> It would be nice if the binary option worked on linux...
Actually it makes no difference on the various unix systems. The size
shouldn't have actually changed at all AFAIK. On a unix system
binary/ascii are the same thing. So you just write to a file and setting
it to binary on unix does nothing so yes it is portable since both methods
of writing are the same.





More information about the Python-list mailing list