Skip to main content

Easily manage files cross platform.

Project description

Package: generalfile

File manager for intuitive cross-platform compatability with gathered useful functionality. Generalfile operates on the middle ground of all relevant operating systems. E.g. Windows being case insensitive -> Don't allow paths with same name but differeing case. Uses a race condition safe lock mechanism for all file operations.

Installation

pip install generalfile

Usage example

from generalfile import Path

Path("newfolder/test.txt").write("foobar")  # Automatically creates new folder
assert Path("newfolder/test.txt").read() == "foobar"
Path("newfolder").delete()  # Delete entire folder

with Path("foo/bar.txt").lock():  # Recursively lock a file or even a folder which doesn't have to exist.
    pass  # The lock is created in a seperate folder, so you're free to do whatever you want in here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

generalfile-2.0.0.tar.gz (11.6 kB view hashes)

Uploaded Source

Built Distribution

generalfile-2.0.0-py3-none-any.whl (14.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page