Skip to main content

RSFILE

https://ci.appveyor.com/api/projects/status/x002hlal3qwiavsa/branch/master

RSFile provides pure-python drop-in replacements for the classes of the io module, and for the open() builtin.

Its goal is to provide a cross-platform, reliable, and comprehensive synchronous file I/O API, with advanced features like fine-grained opening modes, shared/exclusive file record locking, thread-safety, disk cache synchronization, file descriptor inheritability, and handy stat getters (size, inode, times…).

Locking is performed using actual file record locking capabilities of the OS, not by using separate files/directories as locking markers, or other fragile gimmicks.

Possible use cases for this library: concurrently writing to logs without ending up with garbled data, manipulating sensitive data like disk-based databases, synchronizing heterogeneous producer/consumer processes when multiprocessing semaphores aren’t an option, etc.

Tested on CPython3, on windows and unix-like systems. Should work with IronPython/Jython/PyPy too, since it uses stdlib utilities and ctypes bridges.

Read the documentation here: https://rsfile.readthedocs.io/en/latest/

INSTALL

$ pip install rsfile

QUICKSTART

from pathlib import Path
from rsfile import rsopen

path = Path("myfile.txt")

with rsopen(path, "w") as f:
    f.write("This string will be veeeeeryyyyy safely written to file.")

with rsopen(path, "WANISB", locking=False, thread_safe=False) as f:
    f.write(b"See the docs for info on these cool new modes and parameters.")

See CONTRIBUTING.rst for development advice (testing, benchmarking…)

Metadata

Release files for RSFile 3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for RSFile 3.4
File Size Uploaded
rsfile-3.4.tar.gz 473.0 kB Details

Release files / rsfile-3.4.tar.gz

Download URL rsfile-3.4.tar.gz
Size 473.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a19a4c7919dbf56d6be3356c6c41abbf69c9fde7192992dd23eebdf91e0f043e
BLAKE2b-256 checksum
How to use checksums
c777082c410a4839799878061c6d7ef96fec0f03d913064e0c44776240af9f93
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

3.4 This release

1 release file

3.3

2 release files

3.2

2 release files

3.1

2 release files

3.0

1 release file

2.2

1 release file

2.1

2 release files

1.1

3 release files

1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page