Test if a directory exists

Anything QL Software or Programming Related.
User avatar
Andrew
Aurora
Posts: 786
Joined: Tue Jul 17, 2018 9:10 pm

Re: Test if a directory exists

Post by Andrew »

Thank you Derek ! It works !!


Derek_Stewart
Font of All Knowledge
Posts: 3929
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Test if a directory exists

Post by Derek_Stewart »

Hi,

The file commnds are detailed in the Toolkit 2 manual.

It maybe worth looking at the manual as there many useful commands available.


Regards,

Derek
User avatar
Andrew
Aurora
Posts: 786
Joined: Tue Jul 17, 2018 9:10 pm

Re: Test if a directory exists

Post by Andrew »

I read the Toolkit II Manual - but reading it is one thing and remembering everything I read is a different thing :)
I have a very bad scan of the original manual - i had to guess a lot of the words.
Now I found on Dilwyn's site a very good copy of the manual !


EmmBee
Trump Card
Posts: 240
Joined: Fri Jan 13, 2012 5:29 pm
Location: Kent

Re: Test if a directory exists

Post by EmmBee »

If you have Turbo toolkit, you could use ...

Code: Select all

DEFine FuNction valid_dir(dev$)
LOCal L
 L = LEN(dev$)
 IF L: IF dev$(L)="_": IF DEVICE_STATUS(1,dev$)>=0: IF FTYP(\dev$)=255: RETurn 1
 RETurn 0
END DEFine valid_dir
This works as the full directory name has to be supplied. It cannot get confused by the default directories of TK2.
EmmBee


Post Reply