rhettbull / dirsnapshot Goto Github PK
View Code? Open in Web Editor NEWDiff for directories; create snapshots of directories and compare/diff these to the directory or another snapshot
License: MIT License
Diff for directories; create snapshots of directories and compare/diff these to the directory or another snapshot
License: MIT License
Add a user_data column to snapshot table and also a user_data
param to create_snapshot
so user can pass a Callable to add arbitrary data for comparison (e.g. extended attributes, MD5, etc). The user would then need to pass a compare_function
to diff() that would look at this data.
Consolidate create_snapshot
and create_snapshot_in_memory
by allowing snapshot_db
arg to be None. If None, creates in memory.
e.g.
snapshot_on_disk = create_snapshot("/path/to/dir", "dir.snapshot")
snapshot_in_memory = create_snapshot("/path/to/dir", None)
Pass pathlib.Path to compare function to make it easier for user to use a lambda as the function (while getting access to all the Pathlib methods)
Add dirs: bool=True
arg to DirDiff().diff()
that, if False, skips dirs that change (as dirs will always change if files contained in the dirs changed).
Also add --no-dirs to the CLI to use this option.
Links inside sandbox containers cause an error:
dirsnap --snapshot /Users/rhet/Library/Containers/com.apple.Photos/ checked.db
When encountering this type of link:
lrwxr-xr-x rhet staff 19 B Sun Aug 20 12:48:03 2023 Filters โ ../../../../Filters
Causes this:
Traceback (most recent call last):
File "/Users/rhet/.local/bin/dirsnap", line 8, in <module>
sys.exit(cli())
^^^^^
File "/Users/rhet/.local/pipx/venvs/dirsnapshot/lib/python3.11/site-packages/dirsnapshot/__main__.py", line 90, in cli
create_snapshot(
File "/Users/rhet/.local/pipx/venvs/dirsnapshot/lib/python3.11/site-packages/dirsnapshot/dirsnapshot.py", line 78, in create_snapshot
snapshot.init_from_dir(dirpath, snapshot_db, walk, description, filter_function)
File "/Users/rhet/.local/pipx/venvs/dirsnapshot/lib/python3.11/site-packages/dirsnapshot/dirsnapshot.py", line 185, in init_from_dir
self._snapshot(dirpath, walk, conn, cursor, filter_function)
File "/Users/rhet/.local/pipx/venvs/dirsnapshot/lib/python3.11/site-packages/dirsnapshot/dirsnapshot.py", line 384, in _snapshot
statinfo = osstat(pathstr)
^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/Users/rhet/Library/Containers/com.apple.Photos/Data/Library/Filters'
Add len to DirSnapshot so len(snapshot) returns count of records in the snaphost
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.