-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] A way to copy a directory with metadata (and/or recursively) #160
Comments
Given that I'm not so sure how far we want to extend the kinds of metadata supported beyond current set. If it's in POSIX then one could make an argument for it, but if it's specific to a niche file system then the implementation can become hard to maintain or even test. |
Whoops, I meant
Yes, I agree. Extended file attributes are quite common though, supported by pretty much all Unix OSes, including GNU (e.g. in coreutils (like in So, I guess it depends on what feels right for you. (If it’s not worth it, then nevermind. :) |
A quick check on a normal Linux (Mint) system showed the following xattrs to be used: security.capability Though by far the most files have none. |
@Rufflewind is this something you're still keen on? Would love to give it a shot. |
There is uncertainty regarding the scope of what metadata gets copied. Maybe, it'd be useful to have some sort of generic recursive copier, e.g. data Copier = Copier { copyMetadata :: OsPath -> OsPath -> IO () }
copyRecursively :: Copier -> OsPath -> OsPath -> IO () That way the client can customize |
There is no equivalent to the popular
cp -a
available.It is similar to
copyFileWithMetadata
, but for entire directories. It is also very strict about including all metadata (even xargs).cp -a
works recursively, and I’d argue that that’s the main case where copying the metadata makes sense, but maybe the option to only copy the directory metadata and not the files in there should be left open.So maybe a generic
copyMetadata
that works on files, directories, symlinks, and everything else, because it only alters the metadata, which is only stored in the parent directory, and accessible viastat
andxattr
.copyPathRecursivelyWithMetadata
(orarchivePath
?) could then be implemented on top of that.Is that a good thing to add?
The text was updated successfully, but these errors were encountered: