SEEK_SET defined?

R

Roger Miller

I see that the posixfile module is deprecated. Have the SEEK_SET, etc.
constants moved somewhere else, or do I need to define them myself?
 
P

Peter Hansen

Roger said:
I see that the posixfile module is deprecated. Have the SEEK_SET, etc.
constants moved somewhere else, or do I need to define them myself?

In Python 2.5 they have been added to the os module, but for now I think
you are probably expected to just continue using posixfile or define
them yourself.

If you did define them yourself, maybe this would be best, given the
current situation:

import os
try:
os.SEEK_SET
except AttributeError:
os.SEEK_SET, os.SEEK_CUR, os.SEEK_END = range(3)

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top