### megfile.smart Module Functions Source: http://megvii-research.github.io/megfile This section lists the functions available in the megfile.smart module for performing file operations across different protocols. ```APIDOC ## `SmartCacher` Class ### Description Provides caching capabilities for file operations. ### Methods - `SmartCacher.cache_path` ``` ```APIDOC ## `register_copy_func()` ### Description Registers a custom function for copy operations. ``` ```APIDOC ## `smart_abspath(path)` ### Description Returns the absolute path of a given path. ``` ```APIDOC ## `smart_access(path, mode)` ### Description Checks if a path is accessible with the given mode. ``` ```APIDOC ## `smart_cache(path)` ### Description Applies caching to a given path. ``` ```APIDOC ## `smart_combine_open(path, mode)` ### Description Opens a file path with combined open functionalities. ``` ```APIDOC ## `smart_concat(paths)` ### Description Concatenates multiple files or paths. ``` ```APIDOC ## `smart_copy(src, dst)` ### Description Copies a file or directory from a source to a destination. ``` ```APIDOC ## `smart_exists(path)` ### Description Checks if a path exists. ``` ```APIDOC ## `smart_getmd5(path)` ### Description Calculates the MD5 hash of a file. ``` ```APIDOC ## `smart_getmtime(path)` ### Description Gets the last modification time of a path. ``` ```APIDOC ## `smart_getsize(path)` ### Description Gets the size of a file or directory. ``` ```APIDOC ## `smart_glob(path, pattern)` ### Description Finds files matching a pattern in a given path. ``` ```APIDOC ## `smart_glob_stat(path, pattern)` ### Description Finds files matching a pattern and returns their stats. ``` ```APIDOC ## `smart_iglob(path, pattern)` ### Description Returns an iterator for files matching a pattern. ``` ```APIDOC ## `smart_isabs(path)` ### Description Checks if a path is absolute. ``` ```APIDOC ## `smart_isdir(path)` ### Description Checks if a path is a directory. ``` ```APIDOC ## `smart_isfile(path)` ### Description Checks if a path is a file. ``` ```APIDOC ## `smart_islink(path)` ### Description Checks if a path is a symbolic link. ``` ```APIDOC ## `smart_ismount(path)` ### Description Checks if a path is a mount point. ``` ```APIDOC ## `smart_listdir(path)` ### Description Lists the contents of a directory. ``` ```APIDOC ## `smart_load_content(path)` ### Description Loads the entire content of a file. ``` ```APIDOC ## `smart_load_from(path, dst)` ### Description Loads content from a path to a destination. ``` ```APIDOC ## `smart_load_text(path)` ### Description Loads the entire text content of a file. ``` ```APIDOC ## `smart_makedirs(path, exist_ok)` ### Description Creates directories recursively. ``` ```APIDOC ## `smart_move(src, dst)` ### Description Moves a file or directory from a source to a destination. ``` ```APIDOC ## `smart_open(path, mode)` ### Description Opens a file path for reading or writing. ``` ```APIDOC ## `smart_path_join(path, *paths)` ### Description Joins path components intelligently. ``` ```APIDOC ## `smart_readlink(path)` ### Description Reads the target of a symbolic link. ``` ```APIDOC ## `smart_realpath(path)` ### Description Returns the canonical path of a file or directory. ``` ```APIDOC ## `smart_relpath(path, start)` ### Description Returns a relative path from a starting point. ``` ```APIDOC ## `smart_remove(path)` ### Description Removes a file or directory. ``` ```APIDOC ## `smart_rename(src, dst)` ### Description Renames a file or directory. ``` ```APIDOC ## `smart_save_as(content, path)` ### Description Saves content to a specified path. ``` ```APIDOC ## `smart_save_content(path, content)` ### Description Saves content to a file path. ``` ```APIDOC ## `smart_save_text(path, text)` ### Description Saves text content to a file path. ``` ```APIDOC ## `smart_scan(path)` ### Description Scans a directory and returns its contents. ``` ```APIDOC ## `smart_scan_stat(path)` ### Description Scans a directory and returns contents with stats. ``` ```APIDOC ## `smart_scandir(path)` ### Description Returns an iterator for directory entries. ``` ```APIDOC ## `smart_stat(path)` ### Description Gets the status of a path. ``` ```APIDOC ## `smart_symlink(src, dst)` ### Description Creates a symbolic link. ``` ```APIDOC ## `smart_sync(src, dst)` ### Description Synchronizes files from source to destination. ``` ```APIDOC ## `smart_sync_with_progress(src, dst)` ### Description Synchronizes files with progress indication. ``` ```APIDOC ## `smart_touch(path)` ### Description Updates the access and modification times of a file, or creates it if it doesn't exist. ``` ```APIDOC ## `smart_unlink(path)` ### Description Removes a file. ``` ```APIDOC ## `smart_walk(path)` ### Description Generates file names in a directory tree by walking the tree top-down or bottom-up. ``` -------------------------------- ### megfile.smart_path Module - SmartPath Class Source: http://megvii-research.github.io/megfile This section details the methods and attributes of the `SmartPath` class for object-oriented path manipulation. ```APIDOC ## `SmartPath` Class ### Description Represents a file path with enhanced functionalities for various protocols. ### Methods - `SmartPath.absolute()` - `SmartPath.abspath()` - `SmartPath.access(mode)` - `SmartPath.as_posix()` - `SmartPath.as_uri()` - `SmartPath.chmod(mode)` - `SmartPath.cwd()` - `SmartPath.exists()` - `SmartPath.expanduser()` - `SmartPath.from_uri(uri)` - `SmartPath.getmtime()` - `SmartPath.getsize()` - `SmartPath.glob(pattern)` - `SmartPath.glob_stat(pattern)` - `SmartPath.hardlink_to(target)` - `SmartPath.home()` - `SmartPath.iglob(pattern)` - `SmartPath.is_absolute()` - `SmartPath.is_block_device()` - `SmartPath.is_char_device()` - `SmartPath.is_dir()` - `SmartPath.is_fifo()` - `SmartPath.is_file()` - `SmartPath.is_mount()` - `SmartPath.is_relative_to(other)` - `SmartPath.is_reserved()` - `SmartPath.is_socket()` - `SmartPath.is_symlink()` - `SmartPath.iterdir()` - `SmartPath.joinpath(*other)` - `SmartPath.lchmod(mode)` - `SmartPath.listdir()` - `SmartPath.load()` - `SmartPath.lstat()` - `SmartPath.match(pattern)` - `SmartPath.md5()` - `SmartPath.mkdir(mode=0o777, parents=False, exist_ok=False)` - `SmartPath.open(mode='r', buffering=-1, encoding=None, errors=None, newline=None)` - `SmartPath.owner()` - `SmartPath.read_bytes()` - `SmartPath.read_text(encoding=None, errors=None)` - `SmartPath.readlink()` - `SmartPath.realpath()` - `SmartPath.register()` - `SmartPath.relative_to(other)` - `SmartPath.relpath(start)` - `SmartPath.remove()` - `SmartPath.rename(target)` - `SmartPath.replace(target)` - `SmartPath.resolve()` - `SmartPath.rglob(pattern)` - `SmartPath.rmdir()` - `SmartPath.samefile(other)` - `SmartPath.save(content)` - `SmartPath.scan()` - `SmartPath.scan_stat()` - `SmartPath.scandir()` - `SmartPath.stat()` - `SmartPath.symlink(target)` - `SmartPath.symlink_to(target)` - `SmartPath.touch(mode=0o666, exist_ok=True)` - `SmartPath.unlink(missing_ok=False)` - `SmartPath.utime(times=None, ns=None)` - `SmartPath.walk()` - `SmartPath.with_name(name)` - `SmartPath.with_stem(stem)` ### Attributes - `SmartPath.anchor` - `SmartPath.drive` - `SmartPath.name` - `SmartPath.parent` - `SmartPath.parents` - `SmartPath.parts` - `SmartPath.root` - `SmartPath.stem` - `SmartPath.suffix` - `SmartPath.suffixes` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.