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
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
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
Summary: Quick and Dirty but functional......... It doesn't check if the file exist or not $ SET NOON $ OPEN/READ FILE EMPTY_FILE.TXT $ READ/END_OF_FILE=EOF FILE DUMMY_STRING $ !!!! IF NOT EMPTY !!!! $ WRITE S...
Summary: I want to monitor for a file to show up then perform an action. I have made a bunch of command files to perform actions but I can't figure out how to tell if a file has been created. I can submit the ...
Summary: VMS Help tcpdump *Conan The Librarian Provides dump analysis and packet capturing. Format tcpdump ["-B" | d | e | f | l | m | n | "-N" | "-O" | q | s | "-S" | t | v | x ...