tlcurl.url_adapters.file_url_adapter

An adapter for resolving reads/writes to filepath URLs

Module Contents

Classes

Class

Description

FileUrlAdapter

An adapter for resolving reads/writes to filepath URLs

Data

API

logger = getLogger(...)
WINDOWS = None
RAISING_FILE_URL_NAME = \x00
class FileUrlAdapter

Bases: tlcurl.url_adapter.UrlAdapterAsyncFromSync

An adapter for resolving reads/writes to filepath URLs

file_scheme = None
file_protocol = None
schemes() list[Scheme]
read_string_content_from_url(
url: Url,
) str
read_binary_content_from_url(
url: Url,
) bytes
delete_url(
url: Url,
) None
make_dirs(
url: Url,
exist_ok: bool = False,
) None
get_file_size(
url: Url,
) int
exists(
url: Url,
) bool
is_dir(
url: Url,
) bool
is_writable(
url: Url,
) bool
stat(
url: Url,
) _FileUrlAdapterDirEntry

Get status information for a file/directory.

Parameters:

url – The URL of the file/directory to get status for

Returns:

A directory entry object containing file information

Raises:

FileNotFoundError if the file doesn’t exist

list_dir(
url: Url,
) Iterator[UrlAdapterDirEntry]
touch(
url: Url,
) None

Update the last modified timestamp of a file to the current time. Creates the file if it doesn’t exist.

Parameters:

url – The URL of the file to touch