Article View: borland.public.cppbuilder.nativeapi
Article #2261Validating a UNC path?
From: Mike K
Date: Sun, 18 Mar 2007 14:48
Date: Sun, 18 Mar 2007 14:48
21 lines
1754 bytes
1754 bytes
Anyone know how to determine at runtime if a UNC path spec is currently
valid? My app is sleeping for up to a minute trying to find a folder in
a UNC path that points to a volume that is offline. I'm using
DirectoryExists() for this, and this function works fine for local
volumes, but IF its pathspec is UNC and IF the target volume is not on
the network at the moment, this function takes a minute or two to time
out, and the rest of the app is waiting to execute until this function
returns. DirectoryExists() works fine for valid UNC paths:
String logpath;
logpath = "C:\\log_files\\";
if(DirectoryExists(logpath))OpenLogFile(); // this is no problem
logpath = "\\\\FILESERV\\logs\\";
if(DirectoryExists(logpath))OpenLogFile();
If FILESERV is offline, this function has to timeout before control is
passed back to your app.
Is there some alternative to DirectoryExists()?
Technical Details
Message-ID:
<45fd5145$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,ab4fc69609086270,start X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Sun, 18 Mar 2007 09:48:39 -0500 From: Mike K <nospam@nospam.net> User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Validating a UNC path? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 74.38.237.178 Message-ID: <45fd5145$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1174229317 74.38.237.178 (18 Mar 2007 07:48:37 -0800) Lines: 21 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail