Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 23
hebboppp
1044 Views, 22 Replies

Findfile

Hi,

The lisp fonction "findfile" is use to find a file in the AutoCAD library search path or on a specific path.

So, if I want to find a file, for exemple, "winword.exe", whitout a specify path, is there a fonction for that ?

Thanks,

Marcel
22 REPLIES 22
Message 2 of 23
BillZ
in reply to: hebboppp

With doslib, dos_find will find all instances of a file in the drive specified.

Free download at:
www.mcneel.com


Bill
Message 3 of 23
Anonymous
in reply to: hebboppp

(acet-file-dir "winword.exe" "c:\\")
Requires acetutil.arx
--
Cliff

"hebboppp" wrote in message
news:f1111f7.-1@WebX.maYIadrTaRb...
> Hi,
> The lisp fonction "findfile" is use to find a file in the AutoCAD library
search path or on a specific path.
>
> So, if I want to find a file, for exemple, "winword.exe", whitout a
specify path, is there a fonction for that ?
>
> Thanks,
>
> Marcel
>
>
Message 4 of 23
Anonymous
in reply to: hebboppp

(equal acet-functions 'pure-evil)

t

Subtitle: Use doslib functions or wrap the winapi function instead.

"Cliff Middleton" wrote in message
news:664B3EB85002C0B79D623DF75D1BF5AF@in.WebX.maYIadrTaRb...
> (acet-file-dir "winword.exe" "c:\\")
> Requires acetutil.arx
> --
> Cliff
>
> "hebboppp" wrote in message
> news:f1111f7.-1@WebX.maYIadrTaRb...
> > Hi,
> > The lisp fonction "findfile" is use to find a file in the AutoCAD
library
> search path or on a specific path.
> >
> > So, if I want to find a file, for exemple, "winword.exe", whitout a
> specify path, is there a fonction for that ?
> >
> > Thanks,
> >
> > Marcel
Message 5 of 23
Anonymous
in reply to: hebboppp

Agreed, but doslib has no equivalent (that requires no path or only parent).
Would you give a brief outline (or heck, just post the code) on how to use
the winapi function?

"michael puckett" wrote in message
news:3E200F5640E6AEEFD14360865BAC0322@in.WebX.maYIadrTaRb...
> (equal acet-functions 'pure-evil)
>
> t
>
> Subtitle: Use doslib functions or wrap the winapi function instead.
>
> "Cliff Middleton" wrote in message
> news:664B3EB85002C0B79D623DF75D1BF5AF@in.WebX.maYIadrTaRb...
> > (acet-file-dir "winword.exe" "c:\\")
> > Requires acetutil.arx
> > --
> > Cliff
> >
> > "hebboppp" wrote in message
> > news:f1111f7.-1@WebX.maYIadrTaRb...
> > > Hi,
> > > The lisp fonction "findfile" is use to find a file in the AutoCAD
> library
> > search path or on a specific path.
> > >
> > > So, if I want to find a file, for exemple, "winword.exe", whitout a
> > specify path, is there a fonction for that ?
> > >
> > > Thanks,
> > >
> > > Marcel
>
>
Message 6 of 23
Anonymous
in reply to: hebboppp

Just pen a recursive wrapper around either. I post it but it's not currently
at my disposal. Surely another poster has an up to date version.

An old, one-off version (never revisited) exists at

http://www.cadvision.com/puckettm/autolisp/filefind/index.htm

It is slow on large trees (e.g. starting at root directory, but it will
slog thru and file all instances in a given tree (iirc). I believe Eric
penned an improved version based on this one.

PS: said site is dead (not even my isp anymore), so I don't know how long
this url will be good for.

Cheers.

Oh! Sandwich time. *Poof*

"Cliff Middleton" wrote in message
news:735099B58B4F0726B20725EB520E517A@in.WebX.maYIadrTaRb...
> Agreed, but doslib has no equivalent (that requires no path or only
parent).
> Would you give a brief outline (or heck, just post the code) on how to use
> the winapi function?
Message 7 of 23
Anonymous
in reply to: hebboppp

Well since I do not have winword (long story, I just lost about two years of
hard work)

You should be able to look under:

(setq key "HKEY_LOCAL_MACHINE\\Software\\Microsoft\\office")

(setq version (vl-registry-descendents
"HKEY_LOCAL_MACHINE\\Software\\Microsoft\\office"))

(setq apps (vl-registry-descendents
(strcat key "\\" vers)))

(setq dir
(vl-registry-read
(strcat key "\\" vers "\\Word\\InstallRoot")
"Path"))

(setq
f (findfile
(strcat
(substr dir 2 (- (strlen dir) 2))
"\\winword.exe")))


Luis E.

Sorry, I will try to put the above inside a function, but will be until
tomorrow.
Message 8 of 23
Anonymous
in reply to: hebboppp

First:
Michael,
> > (equal acet-functions 'pure-evil)
> > t

I enjoyed your humor!

Cliff,
>Agreed, but doslib has no equivalent (that requires no path or only parent).
>Would you give a brief outline (or heck, just post the code) on how to use
>the winapi function?

Wouldn't this work?

(dos_find "winword.exe")

It does on my machine. (Doslib 5.something)

(startapp (car(dos_find "winword.exe")))

Regards,
Doug
Message 9 of 23
Anonymous
in reply to: hebboppp

I'm using doslib 6.0. Returns nil.
--
Cliff

"Doug Broad" wrote in message
news:848CEAE609F11F72128B53DA1CE17D7B@in.WebX.maYIadrTaRb...
> Wouldn't this work?
>
> (dos_find "winword.exe")
>
> It does on my machine. (Doslib 5.something)
>
> (startapp (car(dos_find "winword.exe")))
>
> Regards,
> Doug
>
>
Message 10 of 23
Anonymous
in reply to: hebboppp

I have a recursor that uses vl-directory-files (is that what you meant by
the winapi function?) but it's a real tortise compared to the despised
acet-file-dir function.
--
Cliff

"michael puckett" wrote in message
news:B533B579FD85CB08F69D5D83AA0CDC1C@in.WebX.maYIadrTaRb...
> Just pen a recursive wrapper around either. I post it but it's not
currently
> at my disposal. Surely another poster has an up to date version.
>
> An old, one-off version (never revisited) exists at
>
> http://www.cadvision.com/puckettm/autolisp/filefind/index.htm
>
> It is slow on large trees (e.g. starting at root directory, but it will
> slog thru and file all instances in a given tree (iirc). I believe Eric
> penned an improved version based on this one.
>
> PS: said site is dead (not even my isp anymore), so I don't know how long
> this url will be good for.
>
> Cheers.
>
> Oh! Sandwich time. *Poof*
>
> "Cliff Middleton" wrote in message
> news:735099B58B4F0726B20725EB520E517A@in.WebX.maYIadrTaRb...
> > Agreed, but doslib has no equivalent (that requires no path or only
> parent).
> > Would you give a brief outline (or heck, just post the code) on how to
use
> > the winapi function?
>
>
Message 11 of 23
Anonymous
in reply to: hebboppp

Strange,
I just downloaded mine today, just to test and it was version 5.1.1. I
wonder if Dale retracted Doslib 6.0 for some reason.
????

I am using Windows NT, A2K, ADT2.0 at this location.
I used appload to load the doslib2k.arx.
Message 12 of 23
Anonymous
in reply to: hebboppp

Nope. I meant the winapi FindFirstFile (and FindNextFile) functions:

http://www.mvps.org/vbnet/index.html?code/fileapi/recursivefiles_minimal.htm

You can actually do it just using Dir$ believe it or not; I'll see if I can
find the version I wrote way back when.

Anyone remember the FindFirst / Next dos interrupt version, 21H 4E & 4F?
lol. Call me weird, but I miss the good old interrupt days as clunky as it
was esp. for interfaces. But that's me; strange.

BTW ...

(car (dos_find "winword.exe"))

==> "C:\\Program Files\\Microsoft Office\\Office\\WINWORD.EXE"

< DosLib 5.1 >

"Cliff Middleton" wrote in message
news:0663B739C32A6B991FD6FA4E46A14DDC@in.WebX.maYIadrTaRb...
> I have a recursor that uses vl-directory-files (is that what you meant by
> the winapi function?) but it's a real tortise compared to the despised
> acet-file-dir function.
> --
> Cliff
Message 13 of 23
Anonymous
in reply to: hebboppp

Did you go to the FTP site to download? The website is woefully
out-of-date...

--
R. Robert Bell, MCSE
www.AcadX.com


"Doug Broad" wrote in message
news:9C8180AAC987C200C5FCD5736E3DFA6C@in.WebX.maYIadrTaRb...
| Strange,
| I just downloaded mine today, just to test and it was version 5.1.1. I
| wonder if Dale retracted Doslib 6.0 for some reason.
| ????
|
| I am using Windows NT, A2K, ADT2.0 at this location.
| I used appload to load the doslib2k.arx.
|
|
|
|
Message 14 of 23
Anonymous
in reply to: hebboppp

Hi Cliff,

Have you tried the "new and improved" version of dos_find included with
DOSLib 6?

-Dale


"Cliff Middleton" wrote in message
news:735099B58B4F0726B20725EB520E517A@in.WebX.maYIadrTaRb...
> Agreed, but doslib has no equivalent (that requires no path or only
parent).
> Would you give a brief outline (or heck, just post the code) on how to use
> the winapi function?
>
> "michael puckett" wrote in message
> news:3E200F5640E6AEEFD14360865BAC0322@in.WebX.maYIadrTaRb...
> > (equal acet-functions 'pure-evil)
> >
> > t
> >
> > Subtitle: Use doslib functions or wrap the winapi function instead.
> >
> > "Cliff Middleton" wrote in message
> > news:664B3EB85002C0B79D623DF75D1BF5AF@in.WebX.maYIadrTaRb...
> > > (acet-file-dir "winword.exe" "c:\\")
> > > Requires acetutil.arx
> > > --
> > > Cliff
> > >
> > > "hebboppp" wrote in message
> > > news:f1111f7.-1@WebX.maYIadrTaRb...
> > > > Hi,
> > > > The lisp fonction "findfile" is use to find a file in the AutoCAD
> > library
> > > search path or on a specific path.
> > > >
> > > > So, if I want to find a file, for exemple, "winword.exe", whitout a
> > > specify path, is there a fonction for that ?
> > > >
> > > > Thanks,
> > > >
> > > > Marcel
> >
> >
>
>
Message 15 of 23
Anonymous
in reply to: hebboppp

Hi Robert,

Yes, I went to the website. So that's it. Oh well. It still worked fine.
Message 16 of 23
Anonymous
in reply to: hebboppp

That's a first! Thanks 🙂

"Doug Broad" wrote in message
news:848CEAE609F11F72128B53DA1CE17D7B@in.WebX.maYIadrTaRb...
> First:
> Michael,
> > > (equal acet-functions 'pure-evil)
> > > t
>
> I enjoyed your humor!
Message 17 of 23
Anonymous
in reply to: hebboppp

Use VL-REGISTRY-READ to retrieve the default value of the following
registry key (watch for word wrap):

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App
Paths\Winword.exe

--
There are 10 kinds of people:
Those who understand binary and those who don't
http://www.acadx.com
http://vbxtender.sourceforge.net


"hebboppp" wrote in message
news:f1111f7.-1@WebX.maYIadrTaRb...
Hi,
The lisp fonction "findfile" is use to find a file in the AutoCAD
library search path or on a specific path.
So, if I want to find a file, for exemple, "winword.exe", whitout a
specify path, is there a fonction for that ?
Thanks,
Marcel
Message 18 of 23
Anonymous
in reply to: hebboppp

Hi Fugier,

excuse for the insistence, did you look at it?

Marco

______________________________________

Your message 06/10/2002:
Hi Alessi,

I'll take a look at it.

Thanks.

Dale Fugier
Robert McNeel & Associates

----- Original Message -----
From: "Alessi Marc'Antonio"
To:
Sent: Friday, June 07, 2002 11:19 AM
Subject: Doslib 6 - dos_getdir


> I post this on news.autodesk.autocad.customization:
>
> DOSLIB 6 (A2K2 - Win NT 4.0)
>
> I have problem with dos_getdir and Universal Naming Convention (UNC) path:
> the OK button is not usable, no directory returns.
>
> Ex.: (dos_getdir "Browse for folder" "\\\\cadserver\\")
>
> no problem on the same path with doslib14
>
>
>
> The same problem with dos_dirp in both 14 and 2K
> (I get nil if the directory exist or not)
>
> Grazie.
>
> Marco
>



"Dale Fugier" ha scritto nel messaggio
news:9858790F8706749E612D1B1312758A87@in.WebX.maYIadrTaRb...
> Hi Cliff,
>
> Have you tried the "new and improved" version of dos_find included with
> DOSLib 6?
>
> -Dale
>
>
Message 19 of 23
Anonymous
in reply to: hebboppp

Thanks for the link.

Command: (dos_version)
"6.0.0"

Command: (car (dos_find "winword.exe"))
nil

"michael puckett" wrote in message
news:12FCBC02BB3FF11F317E57F607117703@in.WebX.maYIadrTaRb...
> Nope. I meant the winapi FindFirstFile (and FindNextFile) functions:
>
>
http://www.mvps.org/vbnet/index.html?code/fileapi/recursivefiles_minimal.htm
>
> You can actually do it just using Dir$ believe it or not; I'll see if I
can
> find the version I wrote way back when.
>
> Anyone remember the FindFirst / Next dos interrupt version, 21H 4E & 4F?
> lol. Call me weird, but I miss the good old interrupt days as clunky as it
> was esp. for interfaces. But that's me; strange.
>
> BTW ...
>
> (car (dos_find "winword.exe"))
>
> ==> "C:\\Program Files\\Microsoft Office\\Office\\WINWORD.EXE"
>
> < DosLib 5.1 >
>
> "Cliff Middleton" wrote in message
> news:0663B739C32A6B991FD6FA4E46A14DDC@in.WebX.maYIadrTaRb...
> > I have a recursor that uses vl-directory-files (is that what you meant
by
> > the winapi function?) but it's a real tortise compared to the despised
> > acet-file-dir function.
> > --
> > Cliff
>
>
Message 20 of 23
Anonymous
in reply to: hebboppp

You're most welcome, lottsa good stuff at the mvps site 🙂

(reasons-for-failure (dos_find "winword.exe"))

( "1: Ummm, is the app actually on this machine?"
"2: Is the current drive not the same as app's drive?"
"3: Is the current version of DosLib wonkey?"
"4: Errr ..."
)


:)


"Cliff Middleton" wrote in message
news:D584F7ECF3F6E38ADD7DAF281ABCC131@in.WebX.maYIadrTaRb...
> Thanks for the link.
>
> Command: (dos_version)
> "6.0.0"
>
> Command: (car (dos_find "winword.exe"))
> nil
>
> "michael puckett" wrote in message
> news:12FCBC02BB3FF11F317E57F607117703@in.WebX.maYIadrTaRb...
> > Nope. I meant the winapi FindFirstFile (and FindNextFile) functions:
> >
> >
>
http://www.mvps.org/vbnet/index.html?code/fileapi/recursivefiles_minimal.htm
> >
> > You can actually do it just using Dir$ believe it or not; I'll see if I
> can
> > find the version I wrote way back when.
> >
> > Anyone remember the FindFirst / Next dos interrupt version, 21H 4E & 4F?
> > lol. Call me weird, but I miss the good old interrupt days as clunky as
it
> > was esp. for interfaces. But that's me; strange.
> >
> > BTW ...
> >
> > (car (dos_find "winword.exe"))
> >
> > ==> "C:\\Program Files\\Microsoft Office\\Office\\WINWORD.EXE"
> >
> > < DosLib 5.1 >
> >
> > "Cliff Middleton" wrote in message
> > news:0663B739C32A6B991FD6FA4E46A14DDC@in.WebX.maYIadrTaRb...
> > > I have a recursor that uses vl-directory-files (is that what you meant
> by
> > > the winapi function?) but it's a real tortise compared to the despised
> > > acet-file-dir function.
> > > --
> > > Cliff
> >
> >
>
>

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

Post to forums  

Autodesk Design & Make Report

”Boost