tlc.core.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

Data

Description

WINDOWS

RAISING_FILE_URL_NAME

API

tlc.core.url_adapters.file_url_adapter.WINDOWS = None
tlc.core.url_adapters.file_url_adapter.RAISING_FILE_URL_NAME = \x00
class tlc.core.url_adapters.file_url_adapter.FileUrlAdapter

Bases: tlc.core.url_adapter.UrlAdapterAsyncFromSync

An adapter for resolving reads/writes to filepath URLs

file_scheme = None
file_protocol = None
schemes() list[tlc.core.url.Scheme]
read_string_content_from_url(url: tlc.core.url.Url) str
read_binary_content_from_url(url: tlc.core.url.Url) bytes
delete_url(url: tlc.core.url.Url) None
make_dirs(url: tlc.core.url.Url, exist_ok: bool = False) None
get_file_size(url: tlc.core.url.Url) int
exists(url: tlc.core.url.Url) bool
is_dir(url: tlc.core.url.Url) bool
is_writable(url: tlc.core.url.Url) bool
stat(url: tlc.core.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: tlc.core.url.Url) collections.abc.Iterator[tlc.core.url_adapter.UrlAdapterDirEntry]
touch(url: tlc.core.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