P
Pekka Niiranen
Hi there,
I am having problem in W2K when using Cygwin's Perl.
My Perl script starts Shell script with System -command;
system(scriptfile). The shell script creates a temporary file
like this:
#!/usr/bin/sh
cat "blah blah" > tempfile
and then exits back to Perl. When I then try to remove
the created "tempfile" from the same Perl script with
"unlink" I find out that Perl does not have access rights to the file.
If I use "readdir" Perl finds the file but nor command
"system(rm $file)" or "unlink($file)" does not work either. However,
when Perl script exits I can remove the file with
normal Bash shell command: "rm tempfile".
It seems that Perl is running with different user rights
than the Shell script. My question is therefore: "How can I remove file
created by the Bash shell script started as subshell from Perl script?"
Should I start another Shell script that executes "rm tempfile"
just for that task?
-pekka-
I am having problem in W2K when using Cygwin's Perl.
My Perl script starts Shell script with System -command;
system(scriptfile). The shell script creates a temporary file
like this:
#!/usr/bin/sh
cat "blah blah" > tempfile
and then exits back to Perl. When I then try to remove
the created "tempfile" from the same Perl script with
"unlink" I find out that Perl does not have access rights to the file.
If I use "readdir" Perl finds the file but nor command
"system(rm $file)" or "unlink($file)" does not work either. However,
when Perl script exits I can remove the file with
normal Bash shell command: "rm tempfile".
It seems that Perl is running with different user rights
than the Shell script. My question is therefore: "How can I remove file
created by the Bash shell script started as subshell from Perl script?"
Should I start another Shell script that executes "rm tempfile"
just for that task?
-pekka-