Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Checking to see if a directory exists?

Author
Message
Nemesis_0_
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Canada
Posted: 17th Nov 2007 02:30
Ok so i was wondering if there is a command to check to see if a directory exists eg:

if C:/program files/nemesis_0_ exists then
do something
else
do something else

so far i have something kinda working with SET DIR and PERFORM CHECKLIST FOR FILES, but when it the directory doesnt exist it just errors out... any ideas?

Nemesis_0_
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Canada
Posted: 17th Nov 2007 02:34
wait! i just discovered the path exist command! let me give er a try

Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 17th Nov 2007 02:36
Wow I didn't know about that command thanks

Nemesis_0_
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Canada
Posted: 17th Nov 2007 02:41 Edited at: 17th Nov 2007 02:53
it says irregular number of brackets ?? i only have

if path exist (c:/program files/test) then
print "it exists"
else
Print "Nope... there is something wrong"
endif
wait key
end

why doesnt it like me :-(

Mr Bigger
19
Years of Service
User Offline
Joined: 31st Jan 2005
Location: was here!
Posted: 17th Nov 2007 03:30 Edited at: 17th Nov 2007 16:44
So close.




AMD 2600+/1GB ram/GeForce 6600oc 256MB/W2KPro/DBPro 6.6.b
Nemesis_0_
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Canada
Posted: 17th Nov 2007 04:54
!!! Its always something small.....

Nemesis_0_
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Canada
Posted: 17th Nov 2007 15:55
what do u add instead of spaces if the directory name has spaces in it????

Robert The Robot
17
Years of Service
User Offline
Joined: 8th Jan 2007
Location: Fireball XL5
Posted: 17th Nov 2007 15:58
A space.
You shouldn't type a space between the command and the brackets.
But spaces are perfectly acceptable as part of a file path.

Here's what the command should be:


On our way 'ome, on our way 'ome...
Nemesis_0_
20
Years of Service
User Offline
Joined: 26th Dec 2003
Location: Canada
Posted: 17th Nov 2007 18:53
ohhhh i misread it and thought it said you shouldnt put a space in the brackets hahaha.... yea every once and a while i put a space there, i know i shouldnt :p its a habbit

Login to post a reply

Server time is: 2024-09-27 08:26:51
Your offset time is: 2024-09-27 08:26:51