Re: AW: Write to a binary file

2007-04-05 Thread Grant Edwards
On 2007-04-05, Thinker <[EMAIL PROTECTED]> wrote: >>> --- START --- >>> import os >>> >>> msg = chr(0x02) + chr(0x36) + chr(0x00) + chr(0x01) + chr(0x0a) + >>> chr(0xb0) + chr(0x77) >>> >>> f = os.open('/dev/pytest', os.O_RDWR) >>> os.write(f,msg) >>> os.close(f) >>> >>> f = file('/dev/pytest', 'w

Re: AW: Write to a binary file

2007-04-05 Thread Gabriel Genellina
En Thu, 05 Apr 2007 11:38:06 -0300, Grant Edwards <[EMAIL PROTECTED]> escribió: > On 2007-04-05, Thomi Aurel RUAG A <[EMAIL PROTECTED]> wrote: > >> The output was: >> --- Start --- >> Pytest write> 02 36 00 01 0a b0 77 >> Pytest write> 02 36 00 01 0a >> Pytest write> b0 77 >> --- END --- > > I'm

Re: AW: Write to a binary file

2007-04-05 Thread Thinker
Grant Edwards wrote: > On 2007-04-05, Thomi Aurel RUAG A <[EMAIL PROTECTED]> wrote: > > >> A simplified test programm to compare the function for opening >> a file i used ("file()") and your suggested "os.open()" showed >> different behaviour. >> >> My simple testprogramm: >> >> --- START --- >>

Re: AW: Write to a binary file

2007-04-05 Thread Grant Edwards
On 2007-04-05, Thomi Aurel RUAG A <[EMAIL PROTECTED]> wrote: > A simplified test programm to compare the function for opening > a file i used ("file()") and your suggested "os.open()" showed > different behaviour. > > My simple testprogramm: > > --- START --- > import os > > msg = chr(0x02) + chr(

AW: Write to a binary file

2007-04-04 Thread Thomi Aurel RUAG A
Hy Mike Thanks for your links, unfortunately they weren't very usefull for my specific problem. Hy Grant Edwards Thanks for your hints. A simplified test programm to compare the function for opening a file i used ("file()") and your suggested "os.open()" showed different behaviour. My simple test

Re: Write to a binary file

2007-04-04 Thread Grant Edwards
On 2007-04-04, Thomi Aurel RUAG A <[EMAIL PROTECTED]> wrote: > I'm using Python 2.4.2 on an ARM (PXA-270) platform (linux-2.6.17). > My Goal is to write a list of bytes down to a file (opened in binary > mode) in one cycle. The crux is that a '0x0a' (line feed) will break the > cycle of one writin

Re: Write to a binary file

2007-04-04 Thread kyosohma
On Apr 4, 11:40 am, "Thomi Aurel RUAG A" <[EMAIL PROTECTED]> wrote: > Hy > I'm using Python 2.4.2 on an ARM (PXA-270) platform (linux-2.6.17). > My Goal is to write a list of bytes down to a file (opened in binary > mode) in one cycle. The crux is that a '0x0a' (line feed) will break the > cycle of

Write to a binary file

2007-04-04 Thread Thomi Aurel RUAG A
Hy I'm using Python 2.4.2 on an ARM (PXA-270) platform (linux-2.6.17). My Goal is to write a list of bytes down to a file (opened in binary mode) in one cycle. The crux is that a '0x0a' (line feed) will break the cycle of one writing into several pieces. Writing to a "simple" file, this wouldn't ca