Thanks for the reply Scott.
The debug option is extremely useful to identify a production failure - as
we all know the internet is not perfect and third parties are not 100%
reliable so we need to cater for anomalies or failures.
So we monitor for a failed process and in this case we email attaching the
http debug file so it can be investigated.
With this issue I am positive that the http_debug() is being called, I
have run the process in debug and stepped through the program to the point
where the unlink is being executed and verified the path and file name are
correct but the file is not deleted and I have found no way to increase
the logging to determine why.
I wrote a very simple test program to duplicate the unlink and it worked -
the file was deleted.
The file and directories have *public access so it is not an authority
As for error checking (and directly from your website) is the following
the only option;
if unlink('/ifstest/littlepgm.com') < 0
Or is there other options on ways to check for a failure on the unlink ?
From: "Scott Klement" <midrange-l@xxxxxxxxxxxxxxxx>
Date: 04/12/2019 05:32 AM
Subject: Re: httpapi debug file appending not replacing
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxxxxxxxx>
I could certainly add error checking to this -- but, I never expected
people to use the debug file in production environments. The idea of the
debug file was to be able to generate diagnostics to send to me when
people are having problems. You see, it was a very common dilemma that
something would not work, and the programmer would have no clue what
information to give me or how to get that information, so I created the
debug file to output lots of diagnostics for them to send to me.
So it was really only intended as something used by developers who were
writing/testing their programs to send to me. It was not intended to be
something people using on an ongoing basis. As such, I didn't take
error handling, et al, seriously.
You mention that the file is growing and not being replaced -- but,
please understand that the only thing that triggers it to be replaced is
when the caller calls http_debug(). So, if the caller has previously
called http_debug() to enable debugging, it would be cleared -- but
after that, they can do any number of requests (millions if needed)
without the file being cleared again -- unless they called http_debug()
again, it would simply keep appending.
So its hard to say from your post whether anything is actually
If indeed they are calling http_debug() to try to replace the file, then
all I can suggest is that I add more error checking so we can see why
it's not clearing/deleting the file.
On 11/30/2019 7:16 PM, Don Brown via MIDRANGE-L wrote:
I am using HTTPAPI on V7R3.authority
I have debugging turned on.
I have found a debug file that is large.
The code suggests the file should be unlinked when the procedure is
The debug file is in /tmp/httpapi_debug.txt and *public has *rwx
The http_debug procedure does the following;reasonable precautions to ensure no viruses are present in this email, MSD
callp http_dclose <== This closes the stream file using
if peStatus = *ON <== Debugging is ON
The result of unlink is not being checked - would this be logged to the
job log ?
How can I determine why the stream file is growing rather than being
recreated on each call to httpapi ?
Thank you for any suggestions
This email has been scanned for computer viruses. Although MSD has taken
cannot accept responsibility for any loss or damage arising from the use
of this email or attachments.
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.