You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking for a way to copy/mirror data from ReadTarFS to OSFS. Everything works fine unless the archive contains symlinks. All copy/mirror methods are implemented via copy_file_internal function which in turn calls openbin method of appropriate FS-inherited object. And in ReadTarFS implementation of openbin there is
if not member.isfile():
raise errors.FileExpected(path)
I get why this check is there - the library strives to be a lowest common denominator for different filesystems and symlinks are not universally-supported. I believe that my current issue can be solved by patching if not member.isfile() to if not (member.isfile() or member.issym()) and using fs.copy.copy_fs with on_copy callback to alter metadata with setinfo call (as symlinks are simply text files with magic attribute set on them).
But it feels that a more general problem lurks there. Currently there is no sane way to customize copying (of both data and metadata) for cases when both filesystems actually support the same set of features and thus it's safe to copy some exotic types of files (like symlinks/sockets/devices/... in tar and ext4).
I like the idea behind this library but lack of such feature makes it unusable for my case. Off the top of my head I can think of one solution. What do you think about it?
PS: Thanks for your time and for an interesting piece of software! =)
The text was updated successfully, but these errors were encountered:
I think the issue here is actually coming from the ReadTarFS implementation.
If you look at the implementation of OSFS (which also powers AppFS and TempFS), openbin will follow the symlink and simply open the linked file. Now, Pyfilesystem2 does not really have a clear behaviour related to symbolic links, but I'd expect them to just work if the link happens to point to a file.
Hi!
I'm looking for a way to copy/mirror data from
ReadTarFS
toOSFS
. Everything works fine unless the archive contains symlinks. All copy/mirror methods are implemented viacopy_file_internal
function which in turn callsopenbin
method of appropriate FS-inherited object. And inReadTarFS
implementation ofopenbin
there isI get why this check is there - the library strives to be a lowest common denominator for different filesystems and symlinks are not universally-supported. I believe that my current issue can be solved by patching
if not member.isfile()
toif not (member.isfile() or member.issym())
and usingfs.copy.copy_fs
withon_copy
callback to alter metadata withsetinfo
call (as symlinks are simply text files with magic attribute set on them).But it feels that a more general problem lurks there. Currently there is no sane way to customize copying (of both data and metadata) for cases when both filesystems actually support the same set of features and thus it's safe to copy some exotic types of files (like symlinks/sockets/devices/... in tar and ext4).
I like the idea behind this library but lack of such feature makes it unusable for my case. Off the top of my head I can think of one solution. What do you think about it?
PS: Thanks for your time and for an interesting piece of software! =)
The text was updated successfully, but these errors were encountered: