Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

It's possible to mount both Apple HFS+ and Microsoft NTFS filesystems under Linux.

Both filesystems support multiple content streams per file, though this is not widely used.

Are there (semi) standard ways to access these filesystem features from Linux? If so are the methods uniform between the two filesystems or are only arcane ad-hoc methods available? (Perhaps something with ioctls?)

share|improve this question
1  
Related: Can 'nix handle NTFS ADS data streams? –  hippietrail Dec 9 '12 at 22:58

1 Answer 1

up vote 5 down vote accepted

ntfs-3g can read alternate data streams in NTFS. From its manpage:

Alternate Data Streams (ADS)

NTFS stores all data in streams. Every file has exactly one unnamed data stream and can have many named data streams. The size of a file is the size of its unnamed data stream. By default, ntfs-3g will only read the unnamed data stream.

By using the options "streams_interface=windows", with the ntfs-3g driver (not possible with lowntfs-3g), you will be able to read any named data streams, simply by specifying the stream's name after a colon. For example:

 cat some.mp3:artist

Named data streams act like normal files, so you can read from them, write to them and even delete them (using rm). You can list all the named data streams a file has by getting the "ntfs.streams.list" extended attribute.

For hfs+ I couldn't find anything conclusive (e.g. kernel documentation), but this question at Super User points to a suggestion:

Add /rsrc to the end of the file name to access the resource fork. I have no I idea where that's documented if anywhere. Edit: Just to clarify I was referring to command-line usage for example cp somefile/rsrc destfile will copy the resouce fork of somefile a file called destfile. All command-line functions work this way. I haven't tested it with anything graphical.

share|improve this answer
1  
Thanks for a very complete answer! One thing, apparently HFS+ now supports an arbitrary number of forks per file like NTFS and not just two. Of course just like on NTFS the feature is almost never used. It seems there's little hope of a standardized way to access them to make them useful for caching non-critical or metadata ... –  hippietrail Dec 9 '12 at 22:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.