File$read

File$read(*, as_text=False, start_byte=0, end_byte=NULL) → bytes | str

Reads the file contents into memory, either as raw bytes or as a string.

Parameters:

as_text : bool, default False Whether to read the file contents as a string. By default, the raw bytes of the file will be returned.

start_byte : int, default 0 The offset byte at which to start reading the file. Allows for reading part of a file. If not specified, the file will be read from the start.

end_byte : int, default NULL The byte at which to stop reading the file, inclusive. Allows for reading part of a file. If not specified, the file will be read to the end.

Returns:

bytes | str

Examples

f = redivis$file("4c10-bk27tqmet.rkgXgUlmnJrEFFC6oWAqqA")

file_content_string = f$read(as_text=True)

Last updated

Was this helpful?