[CLOSED] CHECK FILE for a file on DISK (not on WebFOCUS server).
Can someone provide me a pointer as to why this is not working? I can find lots of info on CHECK FILE holdname HOLD, but not any on named DISK locations. I'm sure this is something simple, can someone point me right?
In a nutshell, this accepts 4 parameters from a querystring (one being &HTMNAME), and writes a file in that location. (this all works perfectly). Before doing that write, I'd like to make sure the file doesn't already exist. This seems to be giving me some fits. Any ideas?
Alternately, how would you read a return code from a DOS command (such as DIR-ing it)? Rather not go that way, but if I have to.....
APP HOLD HELDFILES
APP HOLDMETA HELDFILES
APP HOLDDATA HELDFILES
-SET &RPTNAME = '\\server\share$\folder\' | &HTMNAME ;
FILEDEF BOEFINAL DISK "&RPTNAME"
-IF &LINES GT 0 THEN WRITEFILE ELSE NOWRITE;
-CONTINUE
-WRITEFILE
DEFINE FILE CAR
ORDER/A1 = '1';
OUTLINE/A300 = '<!-- Report: &RPTTITLE -->';
END
TABLE FILE CAR
PRINT
ORDER
OUTLINE
BY COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1;
ON TABLE HOLD AS BT_TEMP_1
END
DEFINE FILE CAR
ORDER/A1 = '2';
OUTLINE/A300 = '<!-- CUID: &CUID -->';
END
TABLE FILE CAR
PRINT
ORDER
OUTLINE
BY COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1;
ON TABLE HOLD AS BT_TEMP_2
END
DEFINE FILE CAR
ORDER/A1 = '3';
OUTLINE/A300 = '<meta HTTP-EQUIV=''REFRESH'' content=''0; url=http://server.com:8080/CrystalReports/viewrpt.cwr?cmsname=mycms.com:6400&|id=&RPTID&|apsuser=username&|apspassword=password&|apsauthtype=secEnterprise''>';
END
TABLE FILE CAR
PRINT
ORDER
OUTLINE
BY COUNTRY NOPRINT
WHERE RECORDLIMIT EQ 1;
ON TABLE HOLD AS BT_TEMP_3
END
TABLE FILE BT_TEMP_1
PRINT
ORDER
OUTLINE
ON TABLE HOLD AS BT_OUT
MORE
FILE BT_TEMP_2
MORE
FILE BT_TEMP_3
END
TABLE FILE BT_OUT
PRINT
OUTLINE
BY ORDER NOPRINT
ON TABLE HOLD AS BOEFINAL FORMAT ALPHA
END
-GOTO THEEND
-NOWRITE
-HTMLFORM BEGIN
<html>
<body>
<h1>File Exists, Exiting</h1>
<body>
<html>
-HTMLFORM END
-GOTO THEEND
-THEEND
This message has been edited. Last edited by: ABT,
Waz, I've looked through several of the manuals and searched the site and web for State, but keep getting results about all the states (i.e. municipalities) that are deploying WebFOCUS. Can you point me to some documentation?
I also found this (http://solution.ibi.com:8080/91591076.html) earlier today, but it looks like it deals with VMS (even though it is identified as a WinNT related item).
Sorry to be so needy.
- ABTThis message has been edited. Last edited by: ABT,
Do you know of any issues with it reading from UNC's? I am looking at a directory with three files that all exist and when I try them, I get that they do not exist.
-SET &RPTNAME = '\\caperomain\EpicReports$\ABT\This File.htm';
DOS STATE "&RPTNAME"
-EXIT
Reply
------------------------------------------------
No HTML Output!
------------------------------------------------
File doesn't exist
Kinda feeling a little like I'm in the twilight zone.
So looks like I'm going to plan B. No UNC support, iffy support for mapped drives, better support for files in APP PATH (a bridge I am not willing to cross for this). sigh. deflated.
I have fex that I use to capture config files that use check to see config backup folder exist first. I include here as you might find useful the method?