Sign in to follow this  
Followers 0
sulfurious

DirExists?

6 posts in this topic

Hi.

I really wish there was a function like If DirExists("\\server\share$") then ....

Right now I can look for a FileExists or a dirgetsize = x then...but I need to know something about it first. Trying to build on fly more things.

Short of hooking into a dll or a windows call, is there an easy UDF for this? I have not seen one.

Any solutions appreciated.

sul

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi.

I really wish there was a function like If DirExists("\\server\share$") then ....

Right now I can look for a FileExists or a dirgetsize = x then...but I need to know something about it first. Trying to build on fly more things.

Short of hooking into a dll or a windows call, is there an easy UDF for this? I have not seen one.

Any solutions appreciated.

sul

<{POST_SNAPBACK}>

hm... check the help file again on the DirGetSize()... you may have missed:

Failure: Returns -1 and sets @error to 1 if the path doesn't exist.

***edit***

i had seperated the function name into 3 parts because i am Re Tar Ded

Edited by cameronsdad

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

Why so it does. Thanx for pointing that out. I went the long way around and wrote error code for that, but did not think to use it as a positive thing.

2 sets of eyes are better than one on .chm's I think.

sul

Share this post


Link to post
Share on other sites

Why so it does. Thanx for pointing that out. I went the long way around and wrote error code for that, but did not think to use it as a positive thing.

2 sets of eyes are better than one on .chm's I think.

sul

<{POST_SNAPBACK}>

np, glad i could help, happens to everyone

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

I wonder what the difference would be between:

1. DirGetSize( $sDir )

and

2. FileExists( $sDir ) And ( StringInStr( FileGetAttrib( $sDir ), "D" ) > 0 )

perhaps implemented as

3.

Func DirExists( $sDir )

Return ( FileExists( $sDir ) And ( StringInStr( FileGetAttrib( $sDir ), "D" ) > 0 ) )

EndFunc

I tend towards 3, as using

If DirExists( "\\Server\share$" ) Then ...

makes the intent of your code obvious.

hm... check the help file again on the DirGetSize()... you may have missed:

***edit***

i had seperated the function name into 3 parts because i am Re Tar Ded

<{POST_SNAPBACK}>

Share this post


Link to post
Share on other sites

This works well for me

; check if exists @homedrive\temp\
DirGetSize(@HomeDrive & "\Temp\")
If @error= 1 Then
    DirCreate(@HomeDrive & "\Temp\")
EndIf

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0