Re: Illegal seek error with seek() and os.lseek()

2013-05-14 Thread Andreas Perstinger
On 14.05.2013 21:00, krishna2pra...@gmail.com wrote: # first, open the file as a plain binary try: self.file = open(/dev/relpcfpga, "r+b", buffering=0) Aren't you missing the quotes for "/dev/relpcfpga"? The method seek() complains "OSError: [Errno 29] Illegal seek" The device relpc

Re: Illegal seek error with seek() and os.lseek()

2013-05-14 Thread Roy Smith
In article <50bf9366-46e0-4a7f-865b-3f7c7b0f6...@googlegroups.com>, krishna2pra...@gmail.com wrote: > I am trying to use os.open() and os.lseek() methods to operate on a device > file in Linux. My code goes something like this - > > # first, open the file as a plain binary > try: > self.

Re: Illegal seek error with seek() and os.lseek()

2013-05-14 Thread mar...@python.net
On Tue, May 14, 2013, at 03:00 PM, krishna2pra...@gmail.com wrote: > I am trying to use os.open() and os.lseek() methods to operate on a > device file in Linux. My code goes something like this - > > # first, open the file as a plain binary > try: > self.file = open(/dev/relpcfpga, "r+b", b

Illegal seek error with seek() and os.lseek()

2013-05-14 Thread krishna2prasad
I am trying to use os.open() and os.lseek() methods to operate on a device file in Linux. My code goes something like this - # first, open the file as a plain binary try: self.file = open(/dev/relpcfpga, "r+b", buffering=0) except IOError: raise IOError ('Failed to open.') # Figu