1. Home
  2. Computing & Technology
  3. Python

Using File Descriptors in Python's os Module

By Al Lukaszewski, About.com

5 of 5

More File Handling Calls - Part 2

  • tcgetpgrp(fd): Returns the process group associated with the control terminal associated with fd. (Unix only)
  • tcsetpgrp(fd, pg): Sets the process group associated with the control terminal associated with fd. (Unix only)
  • ttyname(fd): Returns a string specifying the terminal associated with fd. If no such terminal exists, an OSError exception is raised. (Unix only)
  • write(fd, str): Writes str as a string to the file whose file descriptor is fd. Returns the number of bytes written. This is particularly useful if the connection is interrupted due to a network problem or a full disk.

Index: Using File Descriptors in Python's os Module

  1. Opening a File
  2. What Is a File Descriptor, Anyway?
  3. lseek() and ye can read()
  4. More File Handling Calls - Part 1
  5. More File Handling Calls - Part 2

5 of 5

Explore Python

More from About.com

  1. Home
  2. Computing & Technology
  3. Python
  4. Python Library
  5. Python Modules - Python Library - System Programming With the os Module

©2008 About.com, a part of The New York Times Company.

All rights reserved.