Or you could simply do it like this: :ED USER.PROGRAMS RH.TEST Top of "RH.TEST" in "USER.PROGRAMS", 9 lines, 230 characters. *--: P 001: FILEPATH="./D_VOC" 002: CMD = "if [ -e ":FILEPATH:" ]; then echo yes; else echo no; fi;" 003: PCPERFORM CMD CAPTURING OUTPUT 004: PRINT "OUTPUT=":OUTPUT 005: IF INDEX(OUTPUT, "yes", 1) THEN 006: PRINT "FILE EXISTS" 007: END ELSE 008: PRINT "NO FILE THERE" 009: END Bottom. *--: EX Quit "RH.TEST" in file "USER.PROGRAMS" unchanged. :RUN USER.PROGRAMS RH.TEST OUTPUT=yes FILE EXISTS
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of George Gallen Sent: Tuesday, June 28, 2011 10:16 AM To: U2 Users List Subject: Re: [U2] Verifying file existence Since your using RHEL, would you know the actual directory or this file? if so, why not use unix? [george@alpha]$ ls /usr/hello ls: /usr/hello: No such file or directory [george@alpha]$ ls /bin/rm /bin/rm Or you could write a short script that uses the -f flag, and returns a YES or NO this way, you don't have to worry about the OS changing the wording of an error. if [ -f $1 ] ; then echo "YES" else echo "NO" fi > -----Original Message----- > From: [email protected] [mailto:u2-users- > [email protected]] On Behalf Of Kebbon Irwin > Sent: Tuesday, June 28, 2011 12:54 PM > To: [email protected] > Subject: [U2] Verifying file existence > > > UD 7.1 > RHEL Nahant 4 > I am looking for an elegant way to verify a file in a remote directory > has been created. Because it is a binary file and could be pretty > big, I thought OPENing or OPENSEQing it might not be best. I briefly > looked at "stat" within a PCPERFORM but found the @SYSTEM.RETURN.CODE > returned > 0 whether the file was there or not. > > Any other ideas? > Cheers, > Kebbon Irwin > > _______________________________________________ > U2-Users mailing list > [email protected] > http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
