|
Home > Archive > Programming with dBASE > November 2005 > Folder Exists
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
|
|
| Emily 2005-11-16, 11:23 am |
| How do you check if a folder exists or not?
| |
| Jean-Pierre Martel 2005-11-16, 11:23 am |
| In article <ffd2bLs6FHA.1184@news-server>, emily@happyhouse.com says...
> How do you check if a folder exists or not?
From Gary White:
#define IsDir(cPath) (not (empty(funique(cPath
+'\?.?'))))
? IsDir("c:\windows")
? IsDir("c:\boo")
From Maher Barakat or Bowen Moursund:
#define isdir(d) len(funique(d+"\isdir???.???"))>0
? isdir("c:\windows\temp")
From Romain Strieff:
#define isdir(d) new array().dir(d+"\*.*","D")>0
? isdir("C:\temp")
? isdir("C:")
See also isDir() in :dUFLP:fileex.cc
Jean-Pierre Martel, editor
The dBASE Developers Bulletin
Blue Star dBASE Plus Core Concepts Graduate
| |
| Ivar B. Jessen 2005-11-16, 11:23 am |
| On Wed, 16 Nov 2005 10:31:48 -0500, Emily <emily@happyhouse.com> wrote:
>How do you check if a folder exists or not?
fso = new oleautoclient("Scripting.FileSystemObject")
? fso.folderExists("C:\temp") // true
? fso.folderExists("C:\temp4") // false
Ivar B. Jessen
| |
| Paul Van House 2005-11-16, 8:23 pm |
| In article <ffd2bLs6FHA.1184@news-server>, emily@happyhouse.com says...
> How do you check if a folder exists or not?
>
>
In addition to the others:
?file("<DirName>\nul")
To see if "C:\program files" exists:
?file("C:\Program Files\nul")
--
Paul Van House
remove ".removeme" for e-mail replies
Radio/TV Software and Baseball Stat Software:
http://www.binxsoftware.com
Family Home Page: http://vanhouse.binxsoftware.com
Church Home Page: http://www.ashfordumc.org
|
|
|
|
|