Created
November 3, 2020 20:46
-
-
Save markhenrick/cfc9ba9ed78344ab58cdff88381bfdc2 to your computer and use it in GitHub Desktop.
Quick script to check colocation of files in mergerfs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import xattr | |
import os | |
def get_paths(filename): | |
try: | |
attrs = xattr.xattr(filename) | |
paths = attrs["user.mergerfs.allpaths"].decode("utf-8").split("\x00") | |
if len(paths) != 1: | |
print(filename, paths) | |
except Exception as e: | |
print("Error with", filename, e) | |
for filename in os.listdir("."): | |
get_paths(filename) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment