### Install Experimental Qt GUI for Ratarmount Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Installs an experimental Qt-based graphical user interface for Ratarmount from its development branch. This command installs the GUI and provides instructions on how to run it. ```bash pip install --user --force-reinstall \ 'git+https://github.com/mxmlnkn/ratarmount.git@gui#egginfo=ratarmount'{'core&subdirectory=core',} ratarmount --gui ``` -------------------------------- ### Install Ratarmount from PyPI Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Installs the Ratarmount package from the Python Package Index (PyPI) using pip. This is the standard method for installing the latest stable release. ```bash pip install ratarmount ``` -------------------------------- ### Install Ratarmount Core with Dependencies (Bash) Source: https://github.com/mxmlnkn/ratarmount/blob/master/core/README.md Installs the ratarmountcore Python package with optional dependencies for enhanced archive format support. The `[full]` extra installs all supported compression libraries. ```bash pip install ratarmountcore[full] ``` ```bash pip install ratarmountcore ``` ```bash pip install ratarmountcore[bzip2,gzip] ``` ```bash python3 -m pip install --user --force-reinstall 'git+https://github.com/mxmlnkn/ratarmount.git@develop#egginfo=ratarmountcore&subdirectory=core' ``` ```bash python3 -m pip install --user ratarmount[bzip2] ``` ```bash sudo apt install python3 python3-pip fuse build-essential software-properties-common zlib1g-dev libzstd-dev liblzma-dev ``` -------------------------------- ### Install Latest Ratarmount from GitHub Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Installs the latest development version of Ratarmount directly from its GitHub repository. This command fetches and installs both the core and main packages from the 'develop' branch. ```bash python3 -m pip install --user --force-reinstall \ 'git+https://github.com/mxmlnkn/ratarmount.git@develop#egginfo=ratarmountcore&subdirectory=core' \ 'git+https://github.com/mxmlnkn/ratarmount.git@develop#egginfo=ratarmount' ``` -------------------------------- ### Install and Activate Argument Completion for Ratarmount Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Installs the 'argcomplete' Python package and provides instructions for enabling argument completion for Ratarmount. Users can either add an eval command to their .bashrc or run a script for global activation. ```bash pip install argcomplete # Either add this to your .bashrc eval "$( register-python-argcomplete ratarmount )" # Or run this script to install argcomplete globally (into `~/.bash_completion` and `~/.zshenv`): activate-global-python-argcomplete # Requires a restart of your shell to. ratarmount -- ``` -------------------------------- ### Install Argument Completion for Ratarmount (Debian) Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Installs the python3-argcomplete package on Debian-like systems to enable shell argument completion for Ratarmount and other Python tools. After installation, restarting the shell is required. ```bash sudo apt install python3-argcomplete # Restart your shell. ratarmount -- ``` -------------------------------- ### Install Build Dependencies for Ratarmount (Source) Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Installs additional system dependencies required to build Python packages from source for Ratarmount, particularly when no manylinux wheels are available. This includes build tools and development libraries for compression formats. ```bash sudo apt install \ python3 python3-pip fuse \ build-essential software-properties-common \ zlib1g-dev libzstd-dev liblzma-dev cffi libarchive-dev liblzo2-dev gcc ``` -------------------------------- ### Install Debian Dependencies for Ratarmount Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Installs necessary system dependencies for Ratarmount on Debian-like systems, including Python, pip, FUSE, and sqlite3. This command ensures all required libraries for building and running Ratarmount are present. ```bash sudo apt install python3 python3-pip fuse sqlite3 unar libarchive13 lzop gcc liblzo2-dev ``` -------------------------------- ### Install macOS Dependencies for Ratarmount Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Installs required dependencies for Ratarmount on macOS using Homebrew. This includes macFUSE for filesystem integration and libraries for various compression formats. ```bash brew install macfuse unar libarchive lrzip lzop lzo ``` -------------------------------- ### HTML Embedded Data Structure Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Example of an HTML file structure containing embedded data that can be mounted by Ratarmount. ```html ``` -------------------------------- ### Using the Mount Point Control Interface Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Explains how to use the .ratarmount-control interface to send commands to a running mount process. ```bash ratarmount --control-interface mounted echo "ratarmount -d 3 $PWD/tests/single-file.tar $HOME/mounted" > mounted/.ratarmount-control/command sleep 1 cat mounted/.ratarmount-control/command ``` -------------------------------- ### Programmatic Archive Access with open_mount_source Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Shows how to use the factory function to open various archive types, list contents, lookup metadata, and read file data programmatically in Python. ```python from ratarmountcore.mountsource.factory import open_mount_source # Open a TAR archive archive = open_mount_source("data.tar.gz") # List files in root directory files = archive.list("/") print("Files in root:", files) # Lookup file metadata info = archive.lookup("/path/to/file.txt") if info: print(f"Size: {info.size}, Mode: {oct(info.mode)}, Modified: {info.mtime}") # Read file contents with archive.open(info) as f: content = f.read() print("Content:", content.decode('utf-8')) # Open with recursive mounting (archives within archives) archive = open_mount_source("nested.tar", recursive=True) # Open remote archive via URL archive = open_mount_source("https://example.com/archive.tar.gz") # Open with custom index location archive = open_mount_source( "large_archive.tar.bz2", indexFilePath="/tmp/custom.index.sqlite" ) # Always close when done (or use context manager) archive.__exit__(None, None, None) ``` -------------------------------- ### Open and Read Archive Contents (Python) Source: https://github.com/mxmlnkn/ratarmount/blob/master/core/README.md Demonstrates how to use the `ratarmountcore` library to open an archive, list its contents, and read a specific file. It utilizes the `open_mount_source` factory function to handle different archive types. ```python from ratarmountcore.mountsource.factory import open_mount_source archive = open_mount_source("foo.tar", recursive=True) print(archive.list("/")) info = archive.lookup("/bar") print("Contents of /bar:") with archive.open(info) as file: print(file.read()) ``` -------------------------------- ### Mounting Joined Archive Files Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Demonstrates mounting a set of split archive files as a single coherent archive. ```bash base64 /dev/urandom | head -c $(( 1024 * 1024 )) > 1MiB.dat tar -cjf- 1MiB.dat | split -d --bytes=320K - file.tar.gz. ratarmount file.tar.gz.00 mounted ls -la mounted ``` -------------------------------- ### Combine Mount Sources with Union and Layers Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Explains how to merge multiple sources using UnionMountSource and handle nested archives with AutoMountLayer. ```python from ratarmountcore.mountsource.factory import open_mount_source from ratarmountcore.mountsource.compositing.union import UnionMountSource from ratarmountcore.mountsource.compositing.automount import AutoMountLayer from ratarmountcore.mountsource.formats.folder import FolderMountSource tar1 = open_mount_source("base.tar") tar2 = open_mount_source("updates.tar") folder = FolderMountSource("/path/to/folder") union = UnionMountSource([tar1, tar2, folder]) auto = AutoMountLayer(open_mount_source("container.tar")) info = auto.lookup("/nested.tar/data.txt") with auto.open(info) as f: print(f.read()) union.__exit__(None, None, None) ``` -------------------------------- ### Index and Access Compressed Archives Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Demonstrates creating a SQLite-indexed TAR archive for fast random access and retrieving file statistics. ```python from ratarmountcore import SQLiteIndexedTar tar = SQLiteIndexedTar("large_archive.tar.bz2", writeIndex=True, clearIndexCache=False, encoding="utf-8", verifyModificationTime=False, parallelization=4) info = tar.lookup("/data/sample.csv") with tar.open(info) as f: f.seek(1000000) data = f.read(4096) stats = tar.statfs() print(f"Block size: {stats.get('f_bsize', 512)}") tar.__exit__(None, None, None) ``` -------------------------------- ### Mount Archives with Ratarmount Command-Line Tool Source: https://context7.com/mxmlnkn/ratarmount/llms.txt This collection of bash commands demonstrates how to use the `ratarmount` command-line tool to mount various archive and compressed file formats. It covers TAR archives with different compressions, other archive types like ZIP and RAR, and compressed single files. ```bash # TAR archives (with optional compression) ratarmount archive.tar mountpoint ratarmount archive.tar.gz mountpoint # gzip via rapidgzip/indexed_gzip ratarmount archive.tar.bz2 mountpoint # bzip2 via indexed_bzip2 ratarmount archive.tar.xz mountpoint # xz via python-xz ratarmount archive.tar.zst mountpoint # zstd via indexed_zstd # Other archive formats ratarmount archive.zip mountpoint # ZIP via zipfile ratarmount archive.rar mountpoint # RAR via rarfile ratarmount archive.7z mountpoint # 7z via libarchive/py7zr ratarmount image.squashfs mountpoint # SquashFS/AppImage/Snap ratarmount disk.fat32 mountpoint # FAT12/16/32 via pyfatfs ratarmount disk.ext4 mountpoint # EXT4 via python-ext4 ratarmount archive.sqlar mountpoint # SQLite Archive # Formats via libarchive ratarmount archive.iso mountpoint # ISO 9660 ratarmount archive.cab mountpoint # Microsoft Cabinet ratarmount archive.cpio mountpoint # CPIO ratarmount archive.ar mountpoint # AR archives ratarmount archive.warc mountpoint # Web Archive ratarmount archive.xar mountpoint # XAR # Compressed single files (mounted as uncompressed view) ratarmount file.bz2 mountpoint # -> mountpoint/file ratarmount file.gz mountpoint ratarmount file.xz mountpoint ratarmount file.zst mountpoint ``` -------------------------------- ### Utilizing the MountSource Interface Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Details the methods available on the MountSource object, including directory traversal, version management for duplicate files, and partial file reads. ```python from ratarmountcore.mountsource.factory import open_mount_source from ratarmountcore.mountsource.MountSource import FileInfo import stat with open_mount_source("archive.tar.gz") as archive: # List directory contents - returns iterable of names or dict of FileInfo contents = archive.list("/subdir") for name in contents: print(f"Found: {name}") # Lookup returns FileInfo dataclass with metadata info: FileInfo = archive.lookup("/subdir/file.txt") # Check if path exists if archive.exists("/some/path"): print("Path exists") # Check if path is directory if archive.is_dir("/some/path"): print("Path is directory") # Get number of file versions (for TARs with duplicate entries) num_versions = archive.versions("/duplicate_file.txt") # Access specific version (0 = latest, 1 = oldest) old_info = archive.lookup("/duplicate_file.txt", fileVersion=1) # Read partial file content data = archive.read(info, size=1024, offset=0) # Open file with buffering control with archive.open(info, buffering=0) as f: # unbuffered f.seek(100) chunk = f.read(50) # Check if archive is immutable (for caching optimizations) if archive.is_immutable(): print("Archive won't change") ``` -------------------------------- ### Ratarmount Backend Selection Source: https://github.com/mxmlnkn/ratarmount/blob/master/tests/ratarmount-help.txt Specifies the priority of backends for opening files, allowing multiple backends to be used. Later arguments have higher priority. ```bash --use-backend PySquashfsImage,RatarmountIndex,zipfile ``` -------------------------------- ### Ratarmount CLI Configuration Source: https://github.com/mxmlnkn/ratarmount/blob/master/tests/ratarmount-help.txt Configuration options for mounting TAR archives and managing SQLite index files. ```APIDOC ## CLI Options for ratarmount ### Description This command-line interface allows users to union mount TAR archives and folders. It supports advanced indexing strategies to improve performance and recursive mounting of nested archives. ### Method CLI Execution ### Endpoint ratarmount [mount_point] [options] ### Parameters #### Path Parameters - **mount_point** (string) - Optional - The path to a folder to mount the TAR contents into. Defaults to a folder name based on the input file. #### Query Parameters - **--index-file** (string) - Optional - Path to a specific .index.sqlite file or remote URL. - **--index-folders** (string) - Optional - Paths for storing index files. Supports JSON lists or comma-separated strings. - **--mount/--no-mount** (boolean) - Optional - Toggle whether to create a mount point or exit after index creation. - **--recreate-index** (boolean) - Optional - Force deletion and recreation of existing index files. - **--recursion-depth** (integer) - Optional - Set the depth for recursively mounting archives inside archives. Negative values indicate infinite depth. ### Request Example ratarmount archive.tar /mnt/data --recursion-depth 2 --index-folders '["~/.ratarmount"]' ### Response #### Success Response (0) - **status** (string) - Returns 0 on successful mount or index creation. #### Response Example { "status": "success", "message": "Mounted archive.tar to /mnt/data" } ``` -------------------------------- ### Python Library - open_mount_source Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Factory function for programmatically opening and accessing various archive formats. ```APIDOC ## Python - open_mount_source ### Description The primary factory function used to instantiate a MountSource object for a given archive path. ### Method Python Function Call ### Parameters #### Arguments - **path** (string) - Required - Path to the archive file or URL. - **recursive** (bool) - Optional - Enable recursive mounting for nested archives. - **indexFilePath** (string) - Optional - Path to a custom SQLite index file. ### Request Example from ratarmountcore.mountsource.factory import open_mount_source archive = open_mount_source("data.tar.gz", recursive=True) ``` -------------------------------- ### Configure Ratarmount CLI Parallelization Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Demonstrates how to control CPU core usage and thread allocation for parallel decompression in the Ratarmount CLI. Options include global thread counts, backend-specific settings, and debugging modes. ```bash # Use all available CPU cores for parallel decompression ratarmount -P 0 archive.tar.bz2 mountpoint # Use specific number of threads ratarmount -P 4 archive.tar.gz mountpoint # Disable parallelization (single-threaded) ratarmount -P 1 archive.tar.xz mountpoint # Fine-grained parallelization per backend ratarmount -P "rapidgzip:4,indexed_bzip2:2,:1" archive.tar mountpoint # Keep ratarmount in foreground (useful for debugging) ratarmount -f archive.tar mountpoint # Set debug verbosity level (0-4) ratarmount -d 3 archive.tar mountpoint ``` -------------------------------- ### Ratarmount with GitHub Archives Source: https://github.com/mxmlnkn/ratarmount/blob/master/tests/ratarmount-help.txt Mounts archives directly from a GitHub repository. Requires authentication if the repository is private. ```bash ratarmount github://mxmlnkn:ratarmount@v0.15.2/tests/single-file.tar mountpoint ``` -------------------------------- ### Advanced CLI Archive Handling Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Covers advanced configuration options for the CLI, including custom character encodings, handling incremental backups, recursive mounting, and FUSE-specific mount options. ```bash # Handle archives with non-UTF8 encoded filenames ratarmount --encoding latin1 archive.tar mountpoint # Ignore zero blocks in archive (for -A created TARs) ratarmount --ignore-zeros archive.tar mountpoint # Handle GNU incremental backups ratarmount --gnu-incremental backup.tar mountpoint ratarmount --detect-gnu-incremental backup.tar mountpoint # Strip .tar extension from recursively mounted archives ratarmount --recursive --strip-recursive-tar-extension archive.tar mountpoint # Mount specific subfolder from archive ratarmount -o modules=subdir,subdir=squashfs-root archive.squashfs mountpoint # Specify password for encrypted archives ratarmount --password "secretpass" encrypted.rar mountpoint # Pass FUSE-specific options ratarmount -o allow_other,ro archive.tar mountpoint ``` -------------------------------- ### Ratarmount FUSE Options Source: https://github.com/mxmlnkn/ratarmount/blob/master/tests/ratarmount-help.txt Allows passing comma-separated options directly to the FUSE (Filesystem in Userspace) module for fine-grained control. ```bash -o "allow_other,entry_timeout=2.8,gid=0" ``` -------------------------------- ### Access Local Directories via FolderMountSource Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Wraps a local directory in the MountSource interface to allow uniform access patterns alongside archives. ```python from ratarmountcore.mountsource.formats.folder import FolderMountSource folder = FolderMountSource("/path/to/data") files = folder.list("/") info = folder.lookup("/subdir/file.txt") if info: with folder.open(info) as f: content = f.read() folder.__exit__(None, None, None) ``` -------------------------------- ### Ratarmount with Cloud Storage (S3) Source: https://github.com/mxmlnkn/ratarmount/blob/master/tests/ratarmount-help.txt Mounts archives stored in AWS S3 buckets. Requires AWS credentials to be set as environment variables. ```bash AWS_ACCESS_KEY_ID=aaaaaaaaaaaaaaaaaaaa AWS_SECRET_ACCESS_KEY=bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb \ ratarmount s3://127.0.0.1/bucket/single-file.tar mounted ``` -------------------------------- ### Opening Archives with fsspec URL Chaining Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Shows how to open files within archives using the ratar:// protocol and fsspec URL chaining, including integration with pandas. ```python import fsspec with fsspec.open("ratar://bar::file://tests/single-file.tar.gz") as file: print("Contents of file bar:", file.read()) import pandas as pd with fsspec.open("ratar://bar::file://tests/single-file.tar.gz", compression=None) as file: print("Contents of file bar:", file.read()) ``` -------------------------------- ### Ratarmount Control Interface Source: https://github.com/mxmlnkn/ratarmount/blob/master/tests/ratarmount-help.txt Enables the control interface for the mounted path, allowing for runtime management and debugging. ```bash ratarmount --control-interface mounted ``` -------------------------------- ### CLI - Parallelization and Performance Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Configuring parallel decompression levels for different backends to optimize archive access speed. ```APIDOC ## CLI - Parallelization and Performance ### Description Configures the parallelization level for archive decompression to optimize performance based on CPU availability. ### Method Command Line Execution ### Parameters #### Options - **-P** (string/int) - Optional - Parallelization level. Use '0' for all cores, a specific integer for thread count, or a mapping string (e.g., 'rapidgzip:4,indexed_bzip2:2'). - **-f** (flag) - Optional - Keep process in foreground. - **-d** (int) - Optional - Set debug verbosity level (0-4). ### Request Example ratarmount -P 4 archive.tar.gz mountpoint ``` -------------------------------- ### Accessing Archives via fsspec Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md Demonstrates how to use the SQLiteIndexedTarFileSystem to list and read files directly from an archive using the fsspec interface. ```python from ratarmountcore.SQLiteIndexedTarFsspec import SQLiteIndexedTarFileSystem as ratarfs fs = ratarfs("tests/single-file.tar") print("Files in root:", fs.ls("/", detail=False)) print("Contents of /bar:", fs.cat("/bar")) ``` -------------------------------- ### Clone FileInfo and Access Userdata in Python Source: https://context7.com/mxmlnkn/ratarmount/llms.txt This Python snippet shows how to clone a `FileInfo` object for modification and how to access backend-specific user data, such as the offset within an archive. It then demonstrates exiting an archive context. ```python # Clone FileInfo for modification cloned = info.clone() # userdata contains backend-specific data (e.g., offset in archive) print(f"Userdata: {info.userdata}") archive.__exit__(None, None, None) ``` -------------------------------- ### Python Library - MountSource Interface Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Standardized interface for interacting with mounted archive contents. ```APIDOC ## Python - MountSource Interface ### Description Defines the standard methods available on all archive implementations for file system operations. ### Methods - **list(path)**: Returns directory contents. - **lookup(path, fileVersion)**: Returns FileInfo metadata. - **read(info, size, offset)**: Reads partial file content. - **open(info, buffering)**: Opens a file-like object for reading. ### Response #### Success Response - **FileInfo** (object) - Contains metadata: size, mtime, mode, linkname, uid, gid. ``` -------------------------------- ### Ratarmount Basic Usage Source: https://github.com/mxmlnkn/ratarmount/blob/master/tests/ratarmount-help.txt Mounts a single archive file to a specified mount point. Supports various archive formats like tar, zip, and rar. ```bash ratarmount archive.tar.gz ``` ```bash ratarmount archive.zip mountpoint ``` ```bash ratarmount archive.rar mountpoint ``` -------------------------------- ### Recompress bzip2 to Zstandard via CLI Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md This command uses lbzip2 to decompress a file and pipes the stream into a custom createMultiFrameZstd utility. It sets a block size of 4MB to optimize the resulting Zstandard archive. ```bash lbzip2 -cd well-compressed-file.bz2 | createMultiFrameZstd $(( 4*1024*1024 )) > recompressed.zst ``` -------------------------------- ### Integrate with fsspec Ecosystem Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Shows how to use SQLiteIndexedTarFileSystem with fsspec for URL-based access, chaining, and integration with pandas. ```python from ratarmountcore.SQLiteIndexedTarFsspec import SQLiteIndexedTarFileSystem as ratarfs import fsspec import pandas as pd fs = ratarfs("tests/single-file.tar") print("Files in root:", fs.ls("/", detail=False)) with fsspec.open("ratar://bar::file://tests/single-file.tar.gz") as file: print("Contents:", file.read()) with fsspec.open("ratar://data.csv::file://archive.tar.gz", compression=None) as f: df = pd.read_csv(f) ``` -------------------------------- ### Ratarmount with Password File Source: https://github.com/mxmlnkn/ratarmount/blob/master/tests/ratarmount-help.txt Specifies a file containing newline-separated passwords to be used for encrypted archives. Passwords are tried in order. ```bash --password-file passwords.txt ``` -------------------------------- ### Ratarmount Union Mount Cache Options Source: https://github.com/mxmlnkn/ratarmount/blob/master/tests/ratarmount-help.txt Configures the cache behavior for union mounts, controlling depth, entry limits, and timeouts to optimize performance. ```bash --union-mount-cache-max-depth 1024 ``` ```bash --union-mount-cache-max-entries 100000 ``` ```bash --union-mount-cache-timeout 60 ``` -------------------------------- ### Create Multi-Frame ZStandard Files with Bash Source: https://github.com/mxmlnkn/ratarmount/blob/master/README.md A bash function to split input data into multiple frames and compress them individually using zstd. This ensures the resulting file is seekable by creating a multi-frame structure. ```bash createMultiFrameZstd() { if [ -t 0 ]; then file=$1 frameSize=$2 if [[ ! -f "$file" ]]; then echo "Could not find file '$file'." 1>&2; return 1; fi fileSize=$( stat -c %s -- "$file" ) else if [ -t 1 ]; then echo 'You should pipe the output to somewhere!' 1>&2; return 1; fi echo 'Will compress from stdin...' 1>&2 frameSize=$1 fi if [[ ! $frameSize =~ ^[0-9]+$ ]]; then echo "Frame size '$frameSize' is not a valid number." 1>&2 return 1 fi if [[ -d /dev/shm ]]; then frameFile=$( mktemp --tmpdir=/dev/shm ); fi if [[ -z $frameFile ]]; then frameFile=$( mktemp ); fi if [[ -z $frameFile ]]; then echo "Could not create a temporary file for the frames." 1>&2 return 1 fi if [ -t 0 ]; then true > "$file.zst" for (( offset = 0; offset < fileSize; offset += frameSize )); do dd if="$file" of="$frameFile" bs=$(( 1024*1024 )) \ iflag=skip_bytes,count_bytes skip="$offset" count="$frameSize" 2>/dev/null zstd -c -q -- "$frameFile" >> "$file.zst" done else while true; do dd of="$frameFile" bs=$(( 1024*1024 )) \ iflag=count_bytes count="$frameSize" 2>/dev/null if [[ ! -s "$frameFile" ]]; then break; fi zstd -c -q -- "$frameFile" done fi 'rm' -f -- "$frameFile" } ``` ```bash createMultiFrameZstd foo $(( 4*1024*1024 )) ``` -------------------------------- ### Perform Sorted Batch Insertion via Intermediary Table Source: https://github.com/mxmlnkn/ratarmount/blob/master/benchmarks/BENCHMARKS.md This SQL pattern optimizes insertion performance by using a temporary table with an integer primary key for fast writes. After data collection, the records are migrated to the final table using an ORDER BY clause to ensure the target table is indexed efficiently. ```SQL CREATE TABLE "files_tmp" ( "id" INTEGER PRIMARY KEY, "path" VARCHAR(65535), "name" VARCHAR(65535) ); INSERT INTO files VALUES (0,"abcdef", "ghijklmn"), (1,"opqrst","uvwxyz"), (2,"abcdef", "ghijklmn"); CREATE TABLE "files" ( "path" VARCHAR(65535), "name" VARCHAR(65535), PRIMARY KEY (path,name) ); INSERT INTO "files" (path,name) SELECT path,name FROM "files_tmp" ORDER BY path,name; DROP TABLE "files_tmp"; ``` -------------------------------- ### Retrieve File Metadata with FileInfo Source: https://context7.com/mxmlnkn/ratarmount/llms.txt Accesses detailed file metadata such as size, modification time, and permissions using the FileInfo dataclass. ```python from ratarmountcore.mountsource.MountSource import FileInfo from ratarmountcore.mountsource.factory import open_mount_source import time archive = open_mount_source("archive.tar.gz") info: FileInfo = archive.lookup("/path/to/file.txt") print(f"Size: {info.size} bytes") print(f"Modified: {time.ctime(info.mtime)}") print(f"Mode: {oct(info.mode)}") ```