473,657 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exploring use of Dir("\testdir\n ul")

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

Dir("\testdir\n ul")

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\nu l"), 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 1656
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\Nu l") = "" Then

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

Dir("\testdir\n ul")

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\nu l"), 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\Nu l") = "" Then


Good point. Thx.
So, Dir("C:\Baat\Nu l") 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\Nu l") = "" Then

Good point. Thx.
So, Dir("C:\Baat\Nu l") 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
1148
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 good. Could you help ? conatic - http://www.hesit.net
3
1193
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
3896
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 this. Also, is anyone has any code which does something related to this, please let me know. -Subir
0
925
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. Is anyone aware of a way to do this in C# and the framework? Thanks, Rex code-frog.com@rex (swap around @)
8
1169
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 see that before calling into COM you should call CoInitialize. And that you shoudl also call CoUnitialize at the end of the app. Isn't .NET using COM already? (after all the .NET JIT has a COM interface), do I need to call it?
25
2145
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 problems with the maturity and support when working with Mono. So I was considering Python as an alternative development language. Is Python actively developed and supported on Linux? Would it be a viable option for cross-platform application...
0
8827
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7333
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6167
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2731
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.