Panda3D
Classes | Functions | Variables
direct.stdpy.file Namespace Reference

Classes

class  StreamIOWrapper
 

Functions

def execfile (path, globals=None, locals=None)
 
def exists (path)
 
def getmtime (path)
 
def getsize (path)
 
def isdir (path)
 
def isfile (path)
 
def lexists (path)
 
def listdir (path)
 
def open (file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True)
 
def walk (top, topdown=True, onerror=None, followlinks=True)
 

Variables

def file = open
 
 FileExistsError = IOError
 
 FileNotFoundError = IOError
 
 IsADirectoryError = IOError
 
 PermissionError = IOError
 
 strType = str
 
 unicodeType = unicode
 

Detailed Description

This module reimplements Python's file I/O mechanisms using Panda
constructs.  This enables Python to interface more easily with Panda's
virtual file system, and it also better-supports Panda's
SIMPLE_THREADS model, by avoiding blocking all threads while waiting
for I/O to complete. 

Function Documentation

◆ execfile()

def direct.stdpy.file.execfile (   path,
  globals = None,
  locals = None 
)

◆ exists()

def direct.stdpy.file.exists (   path)

◆ getmtime()

def direct.stdpy.file.getmtime (   path)

◆ getsize()

def direct.stdpy.file.getsize (   path)

◆ isdir()

def direct.stdpy.file.isdir (   path)

◆ isfile()

def direct.stdpy.file.isfile (   path)

◆ lexists()

def direct.stdpy.file.lexists (   path)

◆ listdir()

def direct.stdpy.file.listdir (   path)
Implements os.listdir over vfs. 

◆ open()

def direct.stdpy.file.open (   file,
  mode = 'r',
  buffering = -1,
  encoding = None,
  errors = None,
  newline = None,
  closefd = True 
)

◆ walk()

def direct.stdpy.file.walk (   top,
  topdown = True,
  onerror = None,
  followlinks = True 
)
Implements os.walk over vfs.

Note: we don't support onerror or followlinks; errors are ignored
and links are always followed. 

Variable Documentation

◆ file

def file = open

◆ FileExistsError

FileExistsError = IOError

◆ FileNotFoundError

FileNotFoundError = IOError

◆ IsADirectoryError

IsADirectoryError = IOError

◆ PermissionError

PermissionError = IOError

◆ strType

tuple strType = str

◆ unicodeType

unicodeType = unicode