473,395 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Exploring use of Dir("\testdir\nul")

MLH
Back in '98, Trevor Best posted a 1-liner I
consider to be an excellent suggestion:

Dir("\testdir\nul")

If I have an actual directort named c:\bat
and I run Dir("c:\bat\nul") in the immediate
window, 'nul' is returned. On the other hand,
if I run Dir("c:\baat\nul"), the debug window
just displays an empty line. I was wondering
if that empty line was equivalent to Null and
if I could use IsNull(Dir("c:\baat\nul")) inside
a class module to determine existence of a
directory?
Nov 13 '05 #1
3 1647
Dir() returns a zero length string (""), not Null if it doesn't find the
file. So, instead of IsNull(Dir(etc.)), you would use

If Dir("C:\Baat\Nul") = "" Then

--
Wayne Morgan
MS Access MVP
"MLH" <CR**@NorthState.net> wrote in message
news:ht********************************@4ax.com...
Back in '98, Trevor Best posted a 1-liner I
consider to be an excellent suggestion:

Dir("\testdir\nul")

If I have an actual directort named c:\bat
and I run Dir("c:\bat\nul") in the immediate
window, 'nul' is returned. On the other hand,
if I run Dir("c:\baat\nul"), the debug window
just displays an empty line. I was wondering
if that empty line was equivalent to Null and
if I could use IsNull(Dir("c:\baat\nul")) inside
a class module to determine existence of a
directory?

Nov 13 '05 #2
MLH
On Thu, 15 Sep 2005 18:23:32 GMT, "Wayne Morgan"
<co***************************@hotmail.com> wrote:
Dir() returns a zero length string (""), not Null if it doesn't find the
file. So, instead of IsNull(Dir(etc.)), you would use

If Dir("C:\Baat\Nul") = "" Then


Good point. Thx.
So, Dir("C:\Baat\Nul") returns one of two strings: "Nul" or "".
Sound about right? At any rate, if it returns anything other
than the string "nul", then the directory does not exist.
Nov 13 '05 #3
MLH wrote:
On Thu, 15 Sep 2005 18:23:32 GMT, "Wayne Morgan"
<co***************************@hotmail.com> wrote:

Dir() returns a zero length string (""), not Null if it doesn't find the
file. So, instead of IsNull(Dir(etc.)), you would use

If Dir("C:\Baat\Nul") = "" Then

Good point. Thx.
So, Dir("C:\Baat\Nul") returns one of two strings: "Nul" or "".
Sound about right? At any rate, if it returns anything other
than the string "nul", then the directory does not exist.


Yes, it will be one of the two values.

I would point out that this method hasn't always worked in the past, on
Novell servers accessing from MS-DOS it didn't work, on a directory that
didn't exist the Novell driver would pass the request back to DOS, DOS
shrugged it's shoulders and said "yeah OK, it must exist then" :-\

Never seen this behavior on local disks or Windows servers though.
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: conatic | last post by:
I want to make a script that connect to a ftp and get a list of all pdf stored in the ftp with their path to use the list later. I have tried some script with recursion but can't do something...
3
by: Subir | last post by:
Hi, I am new to this group. I am trying to build an application to see all the contents of the outlook accounts (USING MAPI). Does anyone has any information regarding this ?
2
by: Subir | last post by:
Hi, I am trying to build an application to explore the contents of an outlook .pst files. All the reference that I have seen uses the registry to do so. Does any one know any other way of doing...
0
by: Rex A. Winn, Jr. | last post by:
I'm trying to figure out how I can populate a tree/list in a manner similar to what Windows Explorer does that will allow me to navigate into "Mobile Devices" and then to copy files back and forth....
8
by: Lloyd Dupont | last post by:
I just discovered a COM interface which provide some functionality I need. I know nothing of COM and read the documentation and will apply a slow trial and error process. In the documentation I...
25
by: redefined.horizons | last post by:
I've traditionally been a Java developer, although I play around with LISP. I recently migrated to Linux and I was exploring Mono as an option for development on Linux. However, I've had some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.