For various reasons I decided to use RAR archive to store some data, instead compressed tar.
Happy with decision, except for one thing: I can't find a way to store files sorted. Order of files is important as I plan to query archive and results should be ordered.
My file structure is like this:
2000/ 001.txt 002.txt ... 2001/ ... 2002/ ... 2011/
so folders represent years and files inside are numbered. Using
tar or any program lists files as expected.
If I try to create non-recursive
rar archive (i.e. compress files only in folder 2000), files are stored sorted, but if I try to add files recursively (
rar a -r) then files are messed up.
I can't find any switch except:
n@ Read file names to include from stdin
with which I had no luck to make it usable.
I could call
rar on every file like:
for f in */*.txt ; do rar a -r archive.rar $f ; done
but that's not very smart.
As I commented below answer, I though to update question:
I managed to store sorted files similarly as in above not so clever line:
for d in */ ; do rar a -r archive.rar $d*.txt ; done
which works fine for above particular scenario, of course
I haven't found how to use
n@ switch yet thou. I use
RAR 4.10 beta 5