Computing.Net > Forums > OpenVMS > how to check if a file exists using

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how to check if a file exists using

Reply to Message Icon

Name: Mauricio_Barrero
Date: December 13, 2004 at 09:27:58 Pacific
OS: Alpha 7.2
CPU/Ram: 600Mhz 2G
Comment:

Hi all all, I'm new to the board and I have a quick question: how can I check If a file exists using a conditional (IF..)
I've seen that I could use OPEN/error= and put an error label but this not very efficient for what I need. Any other easier way? thanks a lot



Sponsored Link
Ads by Google

Response Number 1
Name: KIRBY2000
Date: December 13, 2004 at 11:57:00 Pacific
Reply:

Try the F$SEARCH lexical function.

type:
$ HELP LEXICAL F$SEARCH

example:
$ START:
$ FILE = F$SEARCH("SYS$SYSTEM:*.EXE")
$ IF FILE .EQS. "" THEN EXIT
$ SHOW SYMBOL FILE
$ GOTO START

This command procedure displays the file specifications of the latest version of all .exe files in the SYS$SYSTEM directory.
(Only the latest version is returned because an asterisk (*) wildcard character is not used as the version number.)
The filespec argument SYS$SYSTEM:*.EXE is surrounded by quotation marks (" ")
because it is a character string expression.

Thanks, Glen


0

Response Number 2
Name: Mauricio_Barrero
Date: December 13, 2004 at 13:22:35 Pacific
Reply:

Hi Glen thanks for the help!


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to OpenVMS Forum Home


Sponsored links

Ads by Google


Results for: how to check if a file exists using

DCL script to check for empty file www.computing.net/answers/openvms/dcl-script-to-check-for-empty-file/296.html

monitor for files www.computing.net/answers/openvms/monitor-for-files/474.html

How to use tcpdump ? www.computing.net/answers/openvms/how-to-use-tcpdump-/545.html