English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System > Coders. Scripting

 
 
Thread Tools
Old 16 September 2017, 07:50   #1
Frankie
Registered User

 
Join Date: Mar 2016
Location: Yes
Posts: 9
AmigaDOS script: Replacing characters and checking if directory is empty

Hi everyone.

A couple of AmigaDOS shell scripting questions:

1. Is it possible to escape a filename or directory name? eg. Instead of "Example#File.txt", it can be escaped to "Example'#File.txt". I can't think of any way of doing string substitution.

2. Is it possible to check if a directory is empty?

Thanks!
Frankie is offline  
Old 16 September 2017, 14:17   #2
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 2,042
1. Use Arexx. Maybe there is a way doing it in DOS but I don`t know.

2. "list Ram:Clipboards/" outputs: Directory "Ram:Clipboards/" is empty. If you examine this you should be able to check for empty dirs. Or use Arexx.
daxb is offline  
Old 16 September 2017, 14:53   #3
emufan
Registered User
 
Join Date: Feb 2012
Location: #DrainTheSwamp
Posts: 4,546
some aminet tools may help:
CheckEmpty V1.4 - Checks if a directory is empty
list of tools matching string.
emufan is offline  
Old 17 September 2017, 17:18   #4
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,638
1. You almost wrote the solution yourself. An apostrophe will escape a wildcard character. This I never knew, but the AmigaDOS manual does state it:
http://wiki.amigaos.net/wiki/AmigaOS...DOS_Characters
idrougge is offline  
Old 24 September 2017, 19:40   #5
Frankie
Registered User

 
Join Date: Mar 2016
Location: Yes
Posts: 9
I don't want to use Arexx :P

I'd already messed with listing a directory and checking for output, but things became complicated when the directory didn't exist.

Anywho, CheckEmpty did what I want (thanks emufan!). I'd already checked Aminet for string tools but nothing does exactly what I want, so I wrote it in C

Thanks guys!
Frankie 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
AmigaDos script help liviux76 Coders. Scripting 8 09 November 2017 16:20
Checking for genuine CPUs? Mr.Flibble support.Hardware 0 03 July 2015 21:08
Changing date/timestamp of AmigaDOS directory? rhester72 support.Apps 1 27 May 2015 23:42
AmigaDos script file help. T_hairy_bootson support.Apps 0 07 March 2006 10:15
Checking my Religion Axxy request.Modules 0 04 July 2005 19:22

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 15:31.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.06253 seconds with 15 queries