sulfurious Posted August 11, 2005 Posted August 11, 2005 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
seandisanti Posted August 11, 2005 Posted August 11, 2005 (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 August 11, 2005 by cameronsdad
sulfurious Posted August 12, 2005 Author Posted August 12, 2005 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
seandisanti Posted August 12, 2005 Posted August 12, 2005 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
CephasOz Posted August 13, 2005 Posted August 13, 2005 I wonder what the difference would be between:1. DirGetSize( $sDir )and2. FileExists( $sDir ) And ( StringInStr( FileGetAttrib( $sDir ), "D" ) > 0 )perhaps implemented as3.Func DirExists( $sDir )Return ( FileExists( $sDir ) And ( StringInStr( FileGetAttrib( $sDir ), "D" ) > 0 ) )EndFuncI tend towards 3, as usingIf 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}>
Valuater Posted August 13, 2005 Posted August 13, 2005 This works well for me ; check if exists @homedrive\temp\ DirGetSize(@HomeDrive & "\Temp\") If @error= 1 Then DirCreate(@HomeDrive & "\Temp\") EndIf 8)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now