At 16:39 -0700 2007/05/30, Oleg Kobchenko wrote:
--- Joey K Tuttle <[EMAIL PROTECTED]> wrote:
I my description of the upload facility I'm using, I should
have noted that one of the problems I ran into was large files
did not work directly because of buffer limitations in j's
implementation of stdin... So my upload form invoked this CGI
#!/bin/bash
tf=/tmp/fdat$$
cat > $tf
./pfdat $tf "$REMOTE_ADDR" "$HTTP_USER_AGENT" "$$"
were the last line is the call to a j #! script "pfdat" which
did the other things I described in my previous message. This
was a very good work around for the stdin buffering issues.
- joey
This interesting solution would still be an option for some
specific cases of manually configured CGI handlers. It is possibly
not a mainstream JHP for temp folder complication, but to
allow integration these considerations may help:
- the command-line parameters to JHP should be the same as
called with regular JHP handler (there is no need to pass
env vars to command line since they are inherited anyway)
- the indication that stdin is redirected to a file by
means of an environment variable, such that, if set will
indicate JHP to read from that file instead of stdin
Note #! J scripts are not easily portable (at least
require additional configuration). Looking at other
scripting languages, it's perfectly OK to use command-line
in the form
[prefix/]jconsole script_location args ...
Where [prefix/] is plaform specific invokation-level
issue, as opposed to script content, which remains
platform independent.
JHP is script-level portable, and only requires
platform-specific external configuration.
tf=/tmp/fdat$$
Does this shell notation create a unique temp name?
Will the temp file be automatically deleted on process exit?
If not how better arrange that?
Thanks for the additional insights and information. In
Linux/Unix systems, $$ returns the process ID, the PID
is a short integer so PIDs recycle at 32678. The shell
script gets a new PID. The file doesn't disappear on
exit of that process, but the called script makes a
point of explicitly deleting it.
- joey
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm