SBFile#

class lldb.SBFile(*args)#

Represents a file.

Methods Summary

Close(SBFile self)

Create(file[, borrow, force_io_methods])

Create a SBFile from a python file object, with options.

Flush(SBFile self)

GetFile(SBFile self)

Convert this SBFile into a python io.IOBase file object.

IsValid(SBFile self)

MakeBorrowed(lldb)

MakeBorrowedForcingIOMethods(lldb)

MakeForcingIOMethods(lldb)

Read(buffer)

Write(buffer)

Methods Documentation

Close(SBFile self) SBError#
classmethod Create(file, borrow=False, force_io_methods=False)#

Create a SBFile from a python file object, with options.

If borrow is set then the underlying file will not be closed when the SBFile is closed or destroyed.

If force_scripting_io is set then the python read/write methods will be called even if a file descriptor is available.

Flush(SBFile self) SBError#
GetFile(SBFile self) lldb::FileSP#

Convert this SBFile into a python io.IOBase file object.

If the SBFile is itself a wrapper around a python file object, this will return that original object.

The file returned from here should be considered borrowed, in the sense that you may read and write to it, and flush it, etc, but you should not close it. If you want to close the SBFile, call SBFile.Close().

If there is no underlying python file to unwrap, GetFile will use the file descriptor, if available to create a new python file object using open(fd, mode=..., closefd=False)

IsValid(SBFile self) bool#
static MakeBorrowed(lldb::FileSP BORROWED) SBFile#
static MakeBorrowedForcingIOMethods(lldb::FileSP BORROWED_FORCE_IO_METHODS) SBFile#
static MakeForcingIOMethods(lldb::FileSP FORCE_IO_METHODS) SBFile#
Read(buffer) SBError, bytes_read#
Write(buffer) SBError, written_read#