Welcome, Guest. Please login or register.
Amiga Kit Amiga Store Iridium Banner AMIStore App Store A1200/A600 4xIDE Interface

AuthorTopic: AmigaOS 68k development - components, critics, bugs, work-arounds, tips&tricks  (Read 17006 times)

0 Members and 1 Guest are viewing this topic.

Offline kolla

How to delete all empty files (and hopefully only empty files) in a path "path/", using only shell commands provided with the OS, using a broken implementation of locale in the C:List command as well as "forgiving" behaviour of C:Delete regarding non-existing files when more than one argument is given, one can do this...

Code: [Select]
List path/ ALL FILES LFORMAT "Delete *"%p%n*" T:_this_file_is_%b" | Search NONUM T:_this_file_is_empty | Execute

(then one can argue over why List uses "empty" and not "Empty", since it uses "Dir" and "Soft", and why not just a linguistically neutral "0"...)
« Last Edit: March 02, 2020, 11:02:07 AM by kolla »
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM460 and Mac minis with MorphOS
 

Offline kolla

With newer versions of AmigaOS, there is an alternative way of launching shell scripts from Workbench, which doesn't involve IconX - instead of an icon of type "Project", one can set icontype to "Tool", tick attribute (protection bit) "script" and add CLI and DONOTPROMPT as tooltypes - that is select "Shell" in the "Start from:" menu and remove the "Prompt for input:" tick. On double click, the script will just be executed.

These tooltypes do not work with WBLoad though, which only report "object is not of required type"...

I would argue that a text file that has S-bit set, by default should rather be treated as a tool than as a project by Workbench (and/or Deficons).
It should also be possible to tick for H and P protection bits from WBInfo.
« Last Edit: March 09, 2020, 01:25:52 PM by kolla »
B5D6A1D019D5D45BCC56F4782AC220D8B3E2A6CC
---
A3000/060CSPPC+CVPPC/128MB + 256MB BigRAM/Deneb USB
A4000/CS060/Mediator4000Di/Voodoo5/128MB
A1200/Blz1260/IndyAGA/192MB
A1200/Blz1260/64MB
A1200/Blz1230III/32MB
A1200/ACA1221
A600/V600v2/Subway USB
A600/Apollo630/32MB
CD32/SX32/32MB/Plipbox
CD32/TF328
A500/V500v2
A500/MTec520
CDTV
MiSTer, MiST, FleaFPGAs and original Minimig
Peg1, SAM460 and Mac minis with MorphOS