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 testprogramm:
--- 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', 'wb')
f.write(msg)
f.close()
--- END ---
The "pytest" device is a very simple device-driver which prints out
(using "printk()") the buffer delivered to the write function in a
hexadecimal format ("Pytest write[buffer in hex format]").
The output was:
--- Start ---
Pytest write02 36 00 01 0a b0 77
Pytest write02 36 00 01 0a
Pytest writeb0 77
--- END ---
Using os.open will work for me, i wasn't aware of the existence of
several file interaces.
Thanks for your help
regards
Aurel
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 testprogramm:
--- 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', 'wb')
f.write(msg)
f.close()
--- END ---
The "pytest" device is a very simple device-driver which prints out
(using "printk()") the buffer delivered to the write function in a
hexadecimal format ("Pytest write[buffer in hex format]").
The output was:
--- Start ---
Pytest write02 36 00 01 0a b0 77
Pytest write02 36 00 01 0a
Pytest writeb0 77
--- END ---
Using os.open will work for me, i wasn't aware of the existence of
several file interaces.
Thanks for your help
regards
Aurel
Comment