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

t <- redivis$table("demo.example_data_files:yz1s:v1_3.example_file_types:4c10")
f <- t$file("pandas_core.py")

file_contents <- f$read(as_text=TRUE)

Last updated

Was this helpful?