Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
posixfile Namespace Reference

Data Structures

class  _posixfile_
 

Functions

def open
 
def fileopen
 

Variables

int SEEK_SET = 0
 
int SEEK_CUR = 1
 
int SEEK_END = 2
 

Detailed Description

Extended file operations available in POSIX.

f = posixfile.open(filename, [mode, [bufsize]])
      will create a new posixfile object

f = posixfile.fileopen(fileobject)
      will create a posixfile object from a builtin file object

f.file()
      will return the original builtin file object

f.dup()
      will return a new file object based on a new filedescriptor

f.dup2(fd)
      will return a new file object based on the given filedescriptor

f.flags(mode)
      will turn on the associated flag (merge)
      mode can contain the following characters:

  (character representing a flag)
      a       append only flag
      c       close on exec flag
      n       no delay flag
      s       synchronization flag
  (modifiers)
      !       turn flags 'off' instead of default 'on'
      =       copy flags 'as is' instead of default 'merge'
      ?       return a string in which the characters represent the flags
      that are set

      note: - the '!' and '=' modifiers are mutually exclusive.
    - the '?' modifier will return the status of the flags after they
      have been changed by other characters in the mode string

f.lock(mode [, len [, start [, whence]]])
      will (un)lock a region
      mode can contain the following characters:

  (character representing type of lock)
      u       unlock
      r       read lock
      w       write lock
  (modifiers)
      |       wait until the lock can be granted
      ?       return the first lock conflicting with the requested lock
      or 'None' if there is no conflict. The lock returned is in the
      format (mode, len, start, whence, pid) where mode is a
      character representing the type of lock ('r' or 'w')

      note: - the '?' modifier prevents a region from being locked; it is
      query only

Function Documentation

def posixfile.fileopen (   file)
Public routine to get a posixfile object from a Python file object.

Definition at line 227 of file posixfile.py.

228 def fileopen(file):
229  """Public routine to get a posixfile object from a Python file object."""
230  return _posixfile_().fileopen(file)
231 
232 #
233 # Constants
#
def posixfile.open (   name,
  mode = 'r',
  bufsize = -1 
)
Public routine to open a file as a posixfile object.

Definition at line 223 of file posixfile.py.

224 def open(name, mode='r', bufsize=-1):
225  """Public routine to open a file as a posixfile object."""
226  return _posixfile_().open(name, mode, bufsize)

Variable Documentation

int SEEK_CUR = 1

Definition at line 235 of file posixfile.py.

int SEEK_END = 2

Definition at line 236 of file posixfile.py.

int SEEK_SET = 0

Definition at line 234 of file posixfile.py.