| View previous topic :: View next topic |
| Author |
Message |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Thu Mar 11, 2004 10:31 pm Post subject: DIRECTORY exist, how can I do this? |
|
|
I need a way to test if the Directory allready exist, I looked in DIRECTORY and @FILE functions, but no luck...
maybe I just missed the trick  |
|
| Back to top |
|
 |
LiquidCode Moderator Team
Joined: 05 Dec 2000 Posts: 1753 Location: Space and Time
|
Posted: Thu Mar 11, 2004 10:39 pm Post subject: |
|
|
Use the @File() with the D parameter.
| Code: |
%t = @file(C:\NotExist,D)
if @not(%t)
Warn Directory C:\NotExist does not exist.
end
|
_________________ Chris
Http://theblindhouse.com |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Thu Mar 11, 2004 11:09 pm Post subject: |
|
|
I must have had a senior moment
Thanks a bunch buddy.. |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Thu Mar 11, 2004 11:21 pm Post subject: |
|
|
So the below should be legal or OK to use?
| Code: |
IF @NOT(@FILE(C:\folder\folder2,D))
Warn Directory C:\folder\folder2 does not exist.
DIRECTORY CREATE,C:\folder\folder2
END
| [/code:1:392307f514] |
|
| Back to top |
|
 |
Mac Professional Member

Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Thu Mar 11, 2004 11:25 pm Post subject: |
|
|
Yep, although ya might want to ask the user before ya create a dir.
Cheers, Mac  _________________ VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
 |
|
| Back to top |
|
 |
Protected Valued Contributor


Joined: 02 Jan 2001 Posts: 228 Location: Portugal
|
Posted: Fri Mar 12, 2004 9:50 am Post subject: |
|
|
| You can use DIRECTORY CREATE even if the directory already exists - it won't do anything in that case. |
|
| Back to top |
|
 |
|