08 January 2014, 11:14 | #1 |
Paranoid Amigoid
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
|
Script to find orphan folders from icons
Hi guys,
I want some help in order to be able to make a script that will find from .info files if a folder doesn't have an .info file. For example lets say I have these folders: - 1 - 2 - 3 - 4 and the info files: - 1.info - 2.info - 4.info What I want is a script that will output me just the name of the folder "3" that doesn't have an icon. The opposite (finding orphan .info file) is so much easier and I can check it out under DOpus by selecting all the folders and checking out which .info file is not selected. |
08 January 2014, 12:59 | #2 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
AmigaDOS does not have folders, it has drawers.
Code:
list all files p=#?.info lformat="if not exists *"%p%m*"*n echo %p%m*nendif" >ram:script execute ram:script |
08 January 2014, 13:54 | #3 |
BlizzardPPC'less
|
|
08 January 2014, 15:12 | #4 |
Paranoid Amigoid
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
|
Fantastic idea Thomas (I was 100% sure that I'd get a response from you).
Soz about the folder thing btw. I'm the one calling wallpapers as backdrops and I fell into the trap myself :P Cheers |
08 January 2014, 15:48 | #5 |
Paranoid Amigoid
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
|
Hi Thomas, just gave it a spin and it doesn't work as intended.
My example: I have a drawer in RAM: called Test Inside the Test drawer there are 4 drawers named: - 1 - 2 - 3 - 4 Also there are icons for every folder but 3 - 1.info - 2.info - 4.info When I run the command inside the Test drawer I get the following script file output: Code:
if not exists "4" echo 4 endif if not exists "2" echo 2 endif if not exists "1" echo 1 endif Also if other drawers with icons exist recursively on any drawer, they output as well (which is not correct for what I had in mind). |
08 January 2014, 17:02 | #6 |
Registered User
Join Date: Jan 2002
Location: Germany
Posts: 6,985
|
Oops, sorry. Little logic error here. It does what you already can: it finds orphaned icons, not drawers without icons.
This should do the opposite: Code:
list all dirs lformat="if not exists *"%p%n.info*"*n echo %p%n*nendif" >ram:script execute ram:script |
08 January 2014, 17:41 | #7 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,303
|
Here an ARexx script that does the same. However, it can easily expanded.
Code:
/* Find drawers without ".info" files script. * * $VER: FindDrawer.rexx V0.1 (08.01.2014) * Function: Find drawers that do not have a ".info" file. * Requires: rexxtricks.library * Usage: "rx FindDrawer.rexx <source>" * <source> = any path * * Example: "rx FindDrawer.rexx SYS:" * Example: "rx FindDrawer.rexx Games:Adventure/" */ pattern = '#?' /* AmigaDOS pattern */ PARSE ARG source . ; OPTIONS RESULTS IF source = '' | source = '?' THEN DO SAY 'Usage: "rx FindDrawer.rexx <source>"' SAY 'Example: "rx FindDrawer.rexx Games:Adventure/"' EXIT END CALL addLibs() IF ~GETDIR(source, pattern, 'sourceDirs', 'DIRS', 'PATH', 'SUBDIRS') THEN DO SAY 'GETDIR() ERROR! while reading: "'|| source ||'"' EXIT END DO i = 1 TO sourceDirs.0 IF ~EXISTS(sourceDirs.i || '.info') THEN DO SAY sourceDirs.i END END EXIT /* Check/Add libs */ addLibs: libs = 'rexxtricks.library' DO i = 1 TO WORDS(libs) IF ~SHOW('L', WORD(libs, i)) THEN DO IF ADDLIB(WORD(libs, i), 0, -30, 0) = 0 THEN DO ADDRESS COMMAND 'Run >NIL: C:RequestChoice "FindDrawer.rexx" "Can`t open" WORD(libs, i) "_OK"' EXIT END END END RETURN |
08 January 2014, 19:14 | #8 |
Paranoid Amigoid
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
|
Thanks a lot both of you!
I'll try both and see what suits me best for my need The reason I wanted the following script help is because I wanted to copy iGame IFF files from an archive that probably had some folders that my WHDLoad archive DIDN'T have. I checked for example letter A and one drawer had no info (cause it changed the WHD name apparently). To check it out firstly I exported a file via the list command and took it to EXCEL where via IF declaration found out easily. All this procedure was not fast NOR clever by any means alas I thought of asking here the experts EDIT: Both scripts work the same. I didn't like that they both display recursively the drawers but I edited the arexx script and now it works in the first level of directory only. Thanks again Last edited by mfilos; 08 January 2014 at 22:41. |
10 January 2014, 11:33 | #9 |
BlizzardPPC'less
|
You could have copied the iGame IFFs as they are (all dirs), then sort your games-DRAWER(!) by size in DOPUS4 and just delete the dirs that only had the pics in it.
|
10 January 2014, 13:44 | #10 |
Paranoid Amigoid
Join Date: Mar 2008
Location: Athens/Greece
Age: 45
Posts: 1,978
|
True as well!
Cheers man. |
10 January 2014, 17:47 | #11 |
Registered User
Join Date: Feb 2008
Location: RNO
Posts: 1,006
|
I usually call them just directories, which is more universal term I think Although it's usually related to shell usage, but on most platforms at least. I never call them yucky folders and calling them workbenchish drawers can cause understanding problems
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Preinstalls containing 2 folders | TroelsDK | project.WHDLoad | 3 | 04 November 2013 02:26 |
File comments and shared folders | mark_k | support.WinUAE | 2 | 06 December 2012 10:15 |
OS 3.5 icons on 3.1 & WHDLoad hangs when displaying icons | PoulpSquad | support.WinUAE | 22 | 14 September 2012 00:57 |
"Orphan" colour 0 line artifact | mark_k | support.WinUAE | 0 | 24 April 2012 14:01 |
New folders icons for XP | frikilokooo | Retrogaming General Discussion | 0 | 16 November 2007 10:11 |
|
|