On 05/22/2016 03:28 PM, Alan Altmark wrote:
On Friday, 05/20/2016 at 03:05 GMT, Hendrik Brueckner
<[email protected]> wrote:
To recognize the file format the "magic" patterns are used. See also
the
definitions in /usr/share/misc/magic and magic(5) man page. If you know
how to detect packed CMS files, you can add the signature there (or for
testing locally) and check if file is then able to recognize it.
Unfortunately part of the signature is in the LRECL 1024 and RECFM F, but
those aren't visible to apps. The only thing you can do in Linux (without
actually unpacking the file) is
- Check for a file length that's a multiple of 1024
- The first four bytes are 0x000140E5 or 0x000140C6
Hmm,
That doesn't seem right.
In Linux/Unix, a file is simply a byte stream. Any format information
about a structured file should be accessible to the application by some
means, so it can know how to parse the file. Since the CMS file system
stores structured files of different types/modes, this meta information
in the file system should somehow be made available to applications in
Linux/Unix when accessing the file system through cms-fuse. There are
various ways to achieve that, e.g. represent each CMS file by 2 files in
Linux/Unix (similar, I think, to how "resource forks" are handled in
Apple systems), one containing the data, one containing the meta data,
or, alternatively, add a header to each file that represents the meta
data from the file system (though this might break some existing
applications that currently expect to find only the actual data in the
file and somehow "magically" know the meta data...), etc, etc. Finding
the most suitable model will likely require some creative thought on the
part of the developers. Perhaps the representation model can be made to
depend on a mount option, with the default being backward compatible
lack of metadata.
Just simply saying "sorry, this critical meta data from the CMS file
system is not available in Linux" basically means unnecessarily
crippling Linux access to the CMS file system.
Willy
Alan Altmark
Senior Managing z/VM and Linux Consultant
Lab Services System z Delivery Practice
IBM Systems & Technology Group
ibm.com/systems/services/labservices
office: 607.429.3323
mobile; 607.321.7556
[email protected]
IBM Endicott
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/
----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390
----------------------------------------------------------------------
For more information on Linux on System z, visit
http://wiki.linuxvm.org/