Interesting point, but here is why I used the touch command. The touch command has more specific standard error codes. If you use "openseq else writeseq" and both the openseq and writeseq fail, the touch command should provide a little more info. Only happens in obscure cases but it can save you some time. For example, if the filename contains an invalid character, like an exclamation point, the touch command will tell you what the problem is. The openseq and writeseq will tell you the generic "could be permissions, could be something else" status code.
(One major drawback is that the touch command will not work on Windows.) -------------------------------------------------- Charlie Rubeor Senior Database Administrator Wiremold/Legrand 60 Woodlawn Street West Hartford, CT 06110 Tel: 860-233-6251 x3498 Fax: 860-523-3690 Email: [EMAIL PROTECTED] -------------------------------------------------- "Larry Hiscock" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 09/14/2007 07:57 PM Please respond to [email protected] To <[email protected]> cc Subject RE: [U2] [UD] create file You don't need to do the touch command. If the OPENSEQ takes the ELSE branch, but the content of STATUS() is 0, the file does not currently exist, but you can still WRITESEQ to the file handle, and the file will be created. Larry Hiscock Western Computer Services http://www.wcs-corp.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Charlie Rubeor Sent: Friday, September 14, 2007 7:41 AM To: [email protected] Subject: Re: [U2] [UD] create file A lot more lines of code, but this should work. (Please double-check for typos.) FILE.IS.OPEN = 0 LOOP OPENSEQ '/path/file' TO FV ON ERROR PRINT;PRINT 'Could not open the /path/file file, status ':STATUS():'.' STOP END LOCKED PRINT;PRINT 'File /path/file is locked.' SLEEP 1 END THEN FILE.IS.OPEN = 1 END ELSE CMD = '!touch /path/file' EXECUTE CMD CAPTURING OUTPUT RETURNING ERROR.MESSAGE IF @SYSTEM.RETURN.CODE = -1 THEN PRINT;PRINT 'Could not create the /path/file file, status ':STATUS():'.' STOP END END UNTIL FILE.IS.OPEN DO REPEAT [EMAIL PROTECTED] wrote on 09/13/2007 09:44:15 PM: > Hello group, I am a UV guy and I need some UD assistance. > > In UV I can > > OPENSEQ "/path/file" TO FV ELSE > CREATE FV ELSE STOPM "nope" > END > > Which will create the file if it doesn't exit, after which I can > READEQ or > READBLK to my heart's content. > > But UD dies at the CREATE statment. > > Also, instead of READBLK WRITEBLK it is OSBREAD, OSBWRITE in UD, > correct ? > > Thanks, > /Scott Ballinger > Pareto Corporation > Edmonds WA USA > 206 713 6006 > ------- > u2-users mailing list > [email protected] > To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
