[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Temporary files - Debug Files



If the user running the program is the user reading the file, authority should not be a problem assuming the file is created by the user. HTTPAPI should be creating the file with appropriate authority for this function.

A little confusion because you have a named file username+'.html' but you appear to be trying to read the file manually calling it xml_dat which I assume is XML data. But that is not important to the problem.

> For some strange reason the file file1 (Temporal file with ANSWER from previous post) has data on it but the read show a Handle field = 0 when some users do the post.

A file descriptor of zero is okay on the OPEN(). A negative number is an error. So, you can just change your code a bit and maybe it will work for you.

As a little enhancement...
HttpAPI has a temporary file name creator. How about you use that temporary name instead of a "defined" name? Then you would know it was specific to that run of the program.

Psuedo (with some real) code:

file1 = http_tempfile() + '.html';

rc = http_url_get( url : file1 );  

IF rc <> 1;
  Do something with error;
  Unlink(file1);
Else;
  cmd = 'DSPF STMF(''' + file1 + ''')';  
  QCMDEXC(cmd: %len(cmd));
  Unlink(file1);
Endif;


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mario Salgado Montenegro
Sent: Wednesday, March 12, 2014 11:54 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: Temporary files - Debug Files

The example of the problem i have:
For some strange reason the file file1 (Temporal file with ANSWER from
previous post)
has data on it but the read show a Handle field = 0 when some users do the
post.
I don't have a clue how to solve this issue.

   Handle  = open(%trimr(file1):O_RDONLY + O_TEXTDATA);
   if Handle > 0;
     CharsRead = Read(handle : %Addr(xml_dat) : 59941);
     xmldat  = %trim(xml_dat);
     DataLen = read(Handle : %addr(Buffer) : %size(Buffer));
     Exsr armaparseo;
   endif;

Thanks again!
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------