Skip to main content

File

class edge.api.File

Represents a file in the Edge file system. File objects are returned by Folder.open(filename). Please note files are read-only; to change a file's contents, upload (and overwrite) using Folder.upload.

This class has all file-like methods defined on Python's io.RawIOBase interface, appropriate to a read-only file.

Properties

Methods

Reference

basename

Name of the File object.

size

Size of the File object

read()

Read from a file.

Parameters:

  • size (int) — Specify a max size. The default value is -1.

write()

Write to a file object.

seek()

Change the stream position to the given byte offset. The offset is interpreted relative to the position indicated by whence. Valid values for whence are:

  • 0 — Start of stream (the default); offset should be zero or positive
  • 1 — Current stream position; offset may be negative
  • 2 — End of stream; offset is usually negative

Returns:

The new absolute position.

tell()

Return current stream position.

download_url()

Return a resource URL for the specified file.