Problem using lseek

Padraig at Padraig at
Wed Feb 5 17:29:51 CET 2003

Michael Mayhew wrote:
> Greetings,
>     I have been using Python faithfully for the past five months and am 
> quite happy having learned it. That being said, I am currently having a 
> real honey of a problem. I am trying to use the os module's lseek 
> function to set a file descriptor to a new offset position in a file. 
> However, when running the code through the interpreter, I continue 
> receiving a TypeError message:
> Traceback (most recent call last):
>   File "", line 18, in ?
>     os.lseek(somefile, someoffset, 1)
> TypeError: an integer is required

Is this what you want?
os.lseek(somefile.fileno(), someoffset, 1)

note also:


More information about the Python-list mailing list