Subject: | Please add READ share to output logs created by Win32::Job->spawn |
Win32::Job can be used to create a process whose output to stdout and
stderr is captured in log files designated in the options argument
to "spawn".
The log files are created with the FILE_SHARE_WRITE option, but not
the FILE_SHARE_READ option. In Windows (XP), FILE_SHARE_WRITE
apparently does not include FILE_SHARE_READ (i.e., does not allow
shared read-only access - this came as a surprise to me too! See
http://msdn.microsoft.com/en-us/library/aa363874(VS.85).aspx). So,
while the process is running it is not possible for an external source
to "type" or "tail" the log file. I suspect this is not intended
behavior, but it is not certain so I report this as an enhancement
request.
This would be useful if, for example, the user could trigger the
handler function passed to "watch" to abort on a user keypress or some
other mechanism. In my installation, I was not able to watch the log
to determine if my process was hung or it was in a "runaway" state.
Simply adding FILE_SHARE_READ to the creation options would fix this
problem. Specifically, at lines 464 and 488 of "Job.xs", please
consider changing the content of the line from "FILE_SHARE_WRITE,"
to "FILE_SHARE_WRITE | FILE_SHARE_READ,".
I did successfully try this change out in my installation, and the
logs were indeed viewable (at least by 'type').
Thank you for your consideration of this enhancement request.
Operating environment: Windows XP Professional SP2
Perl: ActiveState Perl 5.8.8.822 MSWin32 x86 multithread
Package: Win32::Job (source code modification applied to 0.03).
Subject: | Job.xs |
Message body is not shown because it is too large.