Re: linked file yes or no [message #12808] |
Wed, 09 September 1998 00:00 |
steinhh
Messages: 260 Registered: June 1994
|
Senior Member |
|
|
> did someone know a faster way to get the same information on an unix
> system like
> test_result = (findfile('-l '+file_name))(0)
Yes. See "man lstat" 8-)
The way to do it is to use call_external (or similar) to access the
system routine stat(). Similar to the hack a few months ago to
add a routine called GETPID().
To make the whole thing a bit more flexible, though, and to get
some excercise with dynamically loadable modules (DLM), I wrote
a utility FILESTAT("filename"), which could serve as an example
on how to expand IDL by adding new, useful routines through
the DLM mechanism.
This is also an excellent example on tasks where *tremendous*
speedups (about a factor of 500 on my machine!) may be achieved by
(relatively) simple call_external additions. Of course, portability
(at least to outside the Unix family) is a problem.
In fact, I ended up writing a web page with examples on DLMs.
It's available at
http://www.uio.no/~steinhh/IDL/additions.html
I hope it's of use to people.
Regards,
Stein Vidar
|
|
|