Test if a directory exists

Anything QL Software or Programming Related.
Andrew
Chuggy Microdrive
Posts: 68
Joined: Tue Jul 17, 2018 9:10 pm

Re: Test if a directory exists

Postby Andrew » Sat Oct 06, 2018 12:25 pm

Thank you Derek ! It works !!


Derek_Stewart
QL Wafer Drive
Posts: 1138
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

Re: Test if a directory exists

Postby Derek_Stewart » Sat Oct 06, 2018 1:05 pm

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
Andrew
Chuggy Microdrive
Posts: 68
Joined: Tue Jul 17, 2018 9:10 pm

Re: Test if a directory exists

Postby Andrew » Sat Oct 06, 2018 3:45 pm

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
Bent Pin Expansion Port
Posts: 82
Joined: Fri Jan 13, 2012 5:29 pm
Location: Kent

Re: Test if a directory exists

Postby EmmBee » Sun Oct 07, 2018 12:21 pm

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



Return to “Software & Programming”

Who is online

Users browsing this forum: No registered users and 1 guest