Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Test for presence of mapped drive

7 REPLIES 7
Reply
Message 1 of 8
cprettyman
266 Views, 7 Replies

Test for presence of mapped drive

Is there a way, in Lisp, to test for the presence of a mapped drive? I currently have a few things that test for the presence of a particular file, but I want to just check to see that a given drive letter is responding, without being concerned with what's in it. IE, I want to set up something that says
if the O drive is there, do A, else do B

Thanks
CP
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: cprettyman

Hi CP,

If you have DOSLib, you can use the DOS_DRIVEP function.

For example:

Command: (dos_drivep "C:")
T
Command: (dos_drivep "Z:")
nil

DOSLib is free from www.mcneel.com.

- Dale Fugier


"c.prettyman" wrote in message news:5782308@discussion.autodesk.com...
Is there a way, in Lisp, to test for the presence of a mapped drive? I
currently have a few things that test for the presence of a particular file,
but I want to just check to see that a given drive letter is responding,
without being concerned with what's in it. IE, I want to set up something
that says
if the O drive is there, do A, else do B

Thanks
CP
Message 3 of 8
Anonymous
in reply to: cprettyman

(vl-directory-files "c:")
("$INPLACE.~TR" "$RECYCLE.BIN" "$WINDOWS.~Q" "autoexec.bat" "Boot" "bootmgr"
"BOOTSECT.BAK" ....)

(vl-directory-files "u:")
nil

"c.prettyman" wrote in message news:5782308@discussion.autodesk.com...
Is there a way, in Lisp, to test for the presence of a mapped drive? I
currently have a few things that test for the presence of a particular file,
but I want to just check to see that a given drive letter is responding,
without being concerned with what's in it. IE, I want to set up something
that says
if the O drive is there, do A, else do B

Thanks
CP
Message 4 of 8
Anonymous
in reply to: cprettyman

(findfile "O:\\.")


--
Autodesk Discussion Group Facilitator


wrote in message news:5782308@discussion.autodesk.com...
Is there a way, in Lisp, to test for the presence of a mapped drive? I
currently have a few things that test for the presence of a particular file,
but I want to just check to see that a given drive letter is responding,
without being concerned with what's in it. IE, I want to set up something
that says
if the O drive is there, do A, else do B

Thanks
CP
Message 5 of 8
Anonymous
in reply to: cprettyman

Unfortunately, this one won't work since there's no filename given, it'll
always return nil.

Paul

"Jason Piercey" wrote in message
news:5782655@discussion.autodesk.com...
(findfile "O:\\.")


--
Autodesk Discussion Group Facilitator


wrote in message news:5782308@discussion.autodesk.com...
Is there a way, in Lisp, to test for the presence of a mapped drive? I
currently have a few things that test for the presence of a particular file,
but I want to just check to see that a given drive letter is responding,
without being concerned with what's in it. IE, I want to set up something
that says
if the O drive is there, do A, else do B

Thanks
CP
Message 6 of 8
Anonymous
in reply to: cprettyman

Did you try it?

--
Autodesk Discussion Group Facilitator


"A+P" wrote in message
news:5782799@discussion.autodesk.com...

> Unfortunately, this one won't work since there's
> no filename given, it'll always return nil.
Message 7 of 8
Anonymous
in reply to: cprettyman

Oh, I missed your period following the slashes...very smart.

Paul

"Jason Piercey" wrote in message
news:5782803@discussion.autodesk.com...
Did you try it?

--
Autodesk Discussion Group Facilitator


"A+P" wrote in message
news:5782799@discussion.autodesk.com...

> Unfortunately, this one won't work since there's
> no filename given, it'll always return nil.
Message 8 of 8
cprettyman
in reply to: cprettyman

Brilliant
Thank you all!!!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost