Skip to content

module internal.file

Source: stdlib/internal/file.codon


File

Fields

sz: int

buf: Ptr[byte]

fp: cobj

Magic methods

__init__(self, fp: cobj)

__init__(self, path: str, mode: str)

__init__(self, fd: int, mode: str)

__enter__(self)

__exit__(self)

__iter__(self)

__file_write_gen__(self, g: Generator[T], T: type)

Methods

readlines(self)

write(self, s: str)

read(self, sz: int = -1)

tell(self)

seek(self, offset: int, whence: int)

flush(self)

close(self)


gzFile

Fields

sz: int

buf: Ptr[byte]

fp: cobj

Magic methods

__init__(self, fp: cobj)

__init__(self, path: str, mode: str)

__iter__(self)

__enter__(self)

__exit__(self)

__file_write_gen__(self, g: Generator[T], T: type)

Methods

close(self)

readlines(self)

write(self, s: str)

read(self, sz: int = -1)

tell(self)

seek(self, offset: int, whence: int)

flush(self)


bzFile

Fields

sz: int

buf: Ptr[byte]

fp: cobj

Magic methods

__init__(self, fp: cobj)

__init__(self, path: str, mode: str)

__iter__(self)

__enter__(self)

__exit__(self)

__file_write_gen__(self, g: Generator[T], T: type)

Methods

close(self)

readlines(self)

write(self, s: str)

read(self, sz: int = -1)

flush(self)


open(path, mode: str = "r")


gzopen(path: str, mode: str = "r")


bzopen(path: str, mode: str = "r")


is_binary(path: str)