24 February 2013, 22:07 | #1 |
Registered User
Join Date: Mar 2008
Location: Berlin/Germany
Posts: 226
|
TAR with file name pattern handling
Hi everyone,
I know there are several TAR versions available for the Amiga, but I'm looking for a specific one which supports AmigaDOS place holders for name pattern handling (i.e. #?.txt to gather all files which end with '.txt'). I checked all versions I could find on aminet, but apparently there's only this one which does the job. Sadly, due to a bug it is unable to archive folders. I tried to contact the author, but the e-mail address doesn't seem to exist anymore. Is anyone aware of another version with the desired (or similar) feature? |
24 February 2013, 23:22 | #2 |
Registered User
Join Date: May 2011
Location: Poland
Posts: 37
|
As I see from the guide there you may "specify file names, you can include them as the last arguments on the command line, as follows:
tar OPERATION [OPTION1 OPTION2 ..] [FILE NAME-1 FILE NAME-2 ...]" Perhaps AmigaDOS command LIST with argument LFORMAT may be usefull there to produce list of *.txt files at first and then such output to be used as argument for TAR then... |
25 February 2013, 00:41 | #3 |
Registered User
Join Date: Mar 2008
Location: Berlin/Germany
Posts: 226
|
Using LIST to create and append a list of files to the TAR command line is a good idea. I played around a little with different LIST options and it worked well for files and folders.
Now I'm trying to write a script which enables you to put a list of file and folder names (with or without place holders) and then calls TAR to archive all given files. Using LIST here in a script for file name dumping is a bit tricky, because if the given name is a folder and no place holder is used, it puts the whole content of the folder instead of the folder name itself. Example: Assuming there is a folder called "DirName", Code:
LIST QUICK NOHEAD DirName#? Code:
LIST QUICK NOHEAD DirName |
25 February 2013, 16:43 | #4 |
Registered User
Join Date: May 2011
Location: Poland
Posts: 37
|
Check-out as example how to configure AmigaDOS LIST output (tar options to be configured):
LIST >>RAM:selectedfiles path_to_Dir ALL FILES SUB .txt LFORMAT="tar -options %P%S >>RAM:archive.tar" You have to execute then script RAM:selectedfiles only there. |
25 February 2013, 17:34 | #5 | |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 7,002
|
Quote:
You can surround the name with brackets to make it always be a wildcard. LIST (DirName) will just print DirName if it exists, no matter if it is a file or a directory. However, it will not fail if DirName does not exist. LIST DirName will return an error if it does not exist. LIST (DirName#?) will work as before (list all entries which begin with DirName). |
|
25 February 2013, 18:32 | #6 |
Registered User
Join Date: Aug 2004
Location:
Posts: 3,343
|
Somehow including all files on the command line may not be a good idea, because the length of the command line is limited.
The tar archiver I use (which I think is the one on Aminet here) has an option -T which could be helpful. Running tar without arguments describes that option like this: -T F get names to extract or create from file FSo you can use List or whatever to get a list of filenames in a text file, then use the -T option to tell tar to read names from that file. That version of tar is good for Amiga use since it preserves file protection bits, exact datestamps and comments, which other tar ports might not. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Request for Colour Test pattern pictures | kipper2k | support.Other | 6 | 09 June 2011 08:25 |
Workbench PAttern Image | robpotts | New to Emulation or Amiga scene | 3 | 06 June 2011 18:47 |
AmigaXL install error (tar exit code) | kayt | support.Apps | 3 | 28 July 2010 23:00 |
Sector fill pattern | absence | Coders. General | 7 | 21 March 2009 21:50 |
Multi-file RAR handling | andreas | request.UAE Wishlist | 2 | 23 October 2006 18:45 |
|
|