file descriptors & fdopen

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Scott Frankel

    #1

    file descriptors & fdopen


    Why does os.fdopen('foo. txt', 'w') require an integer?
    Ultimately, I want to create a new file on disk.

    Funny, I can't seem to suss-out how to create a new file without
    resorting
    to os.system('touc h foo.txt'). ... Or maybe not so funny ...
    [color=blue][color=green][color=darkred]
    >>> foo = os.fdopen('foo. txt', 'w')[/color][/color][/color]
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    TypeError: an integer is required


    Thanks in advance!
    Scott



Working...