Skip to content

Instantly share code, notes, and snippets.

@markhenrick
Created November 3, 2020 20:46
Show Gist options
  • Save markhenrick/cfc9ba9ed78344ab58cdff88381bfdc2 to your computer and use it in GitHub Desktop.
Save markhenrick/cfc9ba9ed78344ab58cdff88381bfdc2 to your computer and use it in GitHub Desktop.
Quick script to check colocation of files in mergerfs
#!/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