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

class FileUrlAdapter

Bases: tlcurl.url_adapter.UrlAdapterAsyncFromSync

An adapter for resolving reads/writes to filepath URLs

class FileUrlAdapterDirEntry(
dir_entry: Path,
)

Bases: tlcurl.url_adapter.UrlAdapterDirEntry

is_dir() bool
is_file() bool
mtime() float
mtime_datetime() datetime
property name: str
property path: str
delete_url(
url: Url,
) None
exists(
url: Url,
) bool
file_protocol = None
file_scheme = None
get_file_size(
url: Url,
) int
is_dir(
url: Url,
) bool
is_writable(
url: Url,
) bool
list_dir(
url: Url,
) Iterator[UrlAdapterDirEntry]
make_dirs(
url: Url,
exist_ok: bool = False,
) None
read_binary_content_from_url(
url: Url,
) bytes
read_string_content_from_url(
url: Url,
encoding: str = 'utf-8',
) str
schemes() list[Scheme]
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

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

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