forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


DIRECTORY exist, how can I do this?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Thu Mar 11, 2004 10:31 pm    Post subject: DIRECTORY exist, how can I do this? Reply with quote

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 Confused
Back to top
View user's profile Send private message Visit poster's website
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Thu Mar 11, 2004 10:39 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Thu Mar 11, 2004 11:09 pm    Post subject: Reply with quote

I must have had a senior moment Embarassed
Thanks a bunch buddy..
Back to top
View user's profile Send private message Visit poster's website
vtol
Valued Contributor
Valued Contributor


Joined: 05 Feb 2004
Posts: 656
Location: Eastern Indiana

PostPosted: Thu Mar 11, 2004 11:21 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Thu Mar 11, 2004 11:25 pm    Post subject: Reply with quote

Yep, although ya might want to ask the user before ya create a dir. Wink

Cheers, Mac Smile

_________________
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
View user's profile Send private message Send e-mail
Protected
Valued Contributor
Valued Contributor


Joined: 02 Jan 2001
Posts: 228
Location: Portugal

PostPosted: Fri Mar 12, 2004 9:50 am    Post subject: Reply with quote

You can use DIRECTORY CREATE even if the directory already exists - it won't do anything in that case.
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group