English Amiga Board


Go Back   English Amiga Board > Requests > request.Other

 
 
Thread Tools
Old 08 October 2010, 01:31   #1
MethodGit
Junior Member
 
MethodGit's Avatar
 
Join Date: Dec 2002
Location: The Streets
Age: 39
Posts: 2,731
Is there a WB command at all that can...

...delete a directory and all of its contents (including recursive subdirectories) at once? Basically something akin to the "RD" command in Windows.
MethodGit is offline  
Old 08 October 2010, 01:35   #2
Hungry Horace
Wipe-Out Enthusiast
 
Hungry Horace's Avatar
 
Join Date: Nov 2005
Location: .
Age: 43
Posts: 2,538
delete directoryname#? all ... maybe?

i dont really want to test it thanks!

edit: - yep, seems to do the trick
Hungry Horace is offline  
Old 08 October 2010, 01:49   #3
MethodGit
Junior Member
 
MethodGit's Avatar
 
Join Date: Dec 2002
Location: The Streets
Age: 39
Posts: 2,731
Yup, ultimately googled a bit for it. I is stupid.
MethodGit is offline  
Old 08 October 2010, 04:22   #4
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,645
YEah that works. But it's quite unsafe.
Amiga1992 is offline  
Old 08 October 2010, 04:27   #5
MethodGit
Junior Member
 
MethodGit's Avatar
 
Join Date: Dec 2002
Location: The Streets
Age: 39
Posts: 2,731
True say, but so long as you're only deleting temp directories in, say, RAM:, it's alright.

Okay, another question (just so I don't start yet another thread)...

How do I make a script that executes a specific command on a file-by-file basis? Say something like this IPF2ADF script, but rather than do a file requester, I want WWarp to convert each file one by one, utilising the same script/command. Basically something akin to the "if" command in DOS/Windows (if anyone knows about it).
MethodGit is offline  
Old 08 October 2010, 04:39   #6
Anakirob
Unregistered User
 
Anakirob's Avatar
 
Join Date: Nov 2005
Location: Tasmania
Age: 42
Posts: 893
IF, ELSE and ENDIF, as well as ASK and some other such commands are all part of the standard workbench and should be in the C directory.

Personally I find DOpus great for all my file operations.
Anakirob is offline  
Old 08 October 2010, 08:38   #7
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,001
Quote:
Originally Posted by MethodGit View Post
How do I make a script that executes a specific command on a file-by-file basis?
Code:
set source `requestfile drawersonly`
set dest   `requestfile drawersonly savemode`
list >ram:tempscript "$source" files p=#?.adf lformat="adf2ipf *"%p%n*" *"$dest%m.ipf*""
execute ram:tempscript
Quote:
Originally Posted by Akira View Post
YEah that works. But it's quite unsafe.
If which way is it unsafe? It deletes the directory with all its contents. Why do you call it unsafe?
thomas is offline  
Old 08 October 2010, 20:19   #8
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,645
Quote:
Originally Posted by thomas View Post
If which way is it unsafe? It deletes the directory with all its contents. Why do you call it unsafe?
Because if someone is really stupid it can delete everything in a blink. If you miss something you might as well end up erasing the root or parent of a dir.... who knows :P
As far as I remember, there's no ARE YOU SURE? prompt on that.
Amiga1992 is offline  
Old 08 October 2010, 20:33   #9
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,608
Yeah, it should have a 'ARE YOU SURE?' and another 'REALLY???' prompt for every delete How times have changed
TCD is offline  
Old 08 October 2010, 20:41   #10
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,001
That's not Windows where it asks you if you are sure when you change the position of the mouse. If you use a DOS shell, you should know what you are doing.

rm -R something does not ask, too.
thomas is offline  
Old 08 October 2010, 21:07   #11
Amiga1992
Registered User
 
Join Date: May 2001
Location: ?
Posts: 19,645
That's why I said, it is dangerous in the hands of the stupid.

:P
Amiga1992 is offline  
Old 08 October 2010, 21:51   #12
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,608
Wait, did you just called MG a... nvm
TCD is offline  
Old 09 October 2010, 10:28   #13
cosmicfrog
The 1 who ribbits
 
cosmicfrog's Avatar
 
Join Date: Apr 2006
Location: leek, Staffs, UK
Age: 56
Posts: 3,557
Send a message via MSN to cosmicfrog
ok of topic but how many of us here use the recycle bin I dont
when I delete something I want it to stay deleted .....
cosmicfrog is offline  
Old 09 October 2010, 11:59   #14
HonestFlames
Registered User
 
Join Date: Sep 2010
Location: Telford / England
Posts: 38
delete "temp#?" all

...will delete the directory called 'temp' and all contents. It will also delete any file in the current folder beginning with 'temp...' and any other directories beginning with 'temp...' and all of their contents!
HonestFlames is offline  
Old 09 October 2010, 12:04   #15
TCD
HOL/FTP busy bee
 
TCD's Avatar
 
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,608
Why would you add '#?' anyway? Doesn't make much sense if you only what to delete temp and its contents.
TCD is offline  
Old 09 October 2010, 12:50   #16
cosmicfrog
The 1 who ribbits
 
cosmicfrog's Avatar
 
Join Date: Apr 2006
Location: leek, Staffs, UK
Age: 56
Posts: 3,557
Send a message via MSN to cosmicfrog
format c: oh err wrong os sorry
cosmicfrog is offline  
Old 09 October 2010, 12:56   #17
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,001
There is a difference between dangerous and unsafe. If delete command was unsafe, it would not work correctly, i.e. it would delete things you didn't tell it. But it does not do this, so it is completely safe. It's dangerous as you can tell it to delete important files and it will do that. But it's completely safe to use as long as you are careful in what you tell it to delete.

The temp#? example belongs into the category of stupid users. If you don't understand how paths and wildcards work, you should not use the DOS shell. Stay with DirOpus or such programs then. And keep away from shell scripts.
thomas is offline  
Old 09 October 2010, 12:57   #18
thomas
Registered User
 
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 7,001
Quote:
Originally Posted by cosmicfrog View Post
format c: oh err wrong os sorry

No, right OS. Windows does not allow you to format the boot partition while it is in use. AmigaOS does! And it will succeed!
thomas is offline  
Old 09 October 2010, 14:43   #19
cosmicfrog
The 1 who ribbits
 
cosmicfrog's Avatar
 
Join Date: Apr 2006
Location: leek, Staffs, UK
Age: 56
Posts: 3,557
Send a message via MSN to cosmicfrog
dos command so assume we are in dos and not windows, but you are right

the only dangerus command I can think of was a poke on some cbm pet that overloaded something and could set it on fire, though may be a miff
cosmicfrog is offline  
Old 09 October 2010, 23:13   #20
MethodGit
Junior Member
 
MethodGit's Avatar
 
Join Date: Dec 2002
Location: The Streets
Age: 39
Posts: 2,731
Thanks for the layout, thomas! But the script I'm looking to process takes up more than one line, and I'm having a fair amount of trouble getting "list" to create the list of commands correctly, so I'm thinking of something else.

Do you know if AmigaDOS has anything like the %1, %2 etc references in DOS/Windows, if you wish to execute a batch/script file while adding references to a file/directory at the end? Something like, oooh, this random CMD example:
Code:
adf2adz "blah.adf" "blah.adz"
would execute a batch file named adf2adz.bat that contains a series of commands to deal with files referred to only as "%1" or "%2" inside the script.

Basically I want to do something like that with the Amiga, but in connection with what you gave me in your post in regards to searching for ipfs and referencing them in a series of commands.

If that makes any sense at all.
MethodGit is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Final Command runamuck2 support.Games 7 13 September 2019 16:17
What is the WB command that..... MethodGit request.Other 4 08 October 2010 04:21
Install command mai support.Other 9 09 December 2009 15:33
New Carrier Command -=ARA=- Retrogaming General Discussion 12 18 September 2009 10:37
help with delete command silkworm New to Emulation or Amiga scene 2 09 December 2004 19:14

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:00.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13912 seconds with 13 queries