On 2012-05-03, at 6:10 AM, Pavel Raiskup wrote: >> Something like that looks reasonable. >> One major comment, though, is that the output of >> tar should be parsable, i.e., it should be possible >> to look at the output, figure out what format it is, >> and parse it reliably. The current format doesn't have >> that property, but these extended formats ought to, no? > > I'm not sure if I follow you correctly -- you mean some 'universal' parser > that gets tar's -t output and parses it alway correctly and gets as much info > as possible? > > IIUC -- In previous proposal it is not so easy to achieve this goal in > case that there is the 'vv' (not 'vvv') output requested. There may occur > some ambiguity between --xattrs lines and --acls "added" lines, yes? > > .. other possibility is to add two bytes -- 'CHARACTER COLON' before each > additional line. Extended attributes e.g. "x:" for --xattrs, "a:" for > --acls and "s:" for security context. Again -- the 'vvv' is not needed > now and even its header can go out. Or .. > > .. do you (or other listener of this channel) see even other better > solution?
If you are looking for an output format that is relatively easy for humans to read, but is still well formatted and machine parseable, please consider using YAML. This is a colon-delimited text format, similar to what you propose above, but has a few more features. There are YAML parsers for virtually every language, so should be considered as the first choice of machine-readable textual output, rather than inventing some new format. Cheers, Andreas
