rsh & perl -Directory creation not possible

Q

qazmlp

I have a perl script which creates a directory in the local machine.
But, if I call this script from the remote machine using rsh, the
directory is not created. And there is no error message reported. Why
is that so ?

What is the remedy for this ?
 
G

Gregory Toomey

It was a dark and stormy night, and qazmlp managed to scribble:
I have a perl script which creates a directory in the local machine.
But, if I call this script from the remote machine using rsh, the
directory is not created. And there is no error message reported. Why
is that so ?

What is the remedy for this ?

Does the script make any assumptions about which dirctory it starts in?
Write debugging messages to /tmp

gtoomey
 
T

Tintin

qazmlp said:
I have a perl script which creates a directory in the local machine.
But, if I call this script from the remote machine using rsh, the
directory is not created. And there is no error message reported. Why
is that so ?

What is the remedy for this ?

Does your script have something like?

mkdir '/path/to/dir' or die "Can not mkdir /path/to/dir $!\n";

If not, why not?
 
Q

qazmlp

Tintin said:
Does your script have something like?

mkdir '/path/to/dir' or die "Can not mkdir /path/to/dir $!\n";

If not, why not?

I have mkdir command in the script.
When the rsh was executed with 'mkdir' directly, it worked and the
directory was created. But, when the perl script(containing mkdir) was
executed, it did not work.
 
R

Roy Johnson

I have a perl script which creates a directory in the local machine.

It is better to post the relevant chunks of code than merely to
describe them. In Perl, There Is More Than One Way To Do It, and there
may be a problem with the Way you have chosen.
 
T

Tintin

qazmlp said:
"Tintin" <[email protected]> wrote in message

I have mkdir command in the script.
When the rsh was executed with 'mkdir' directly, it worked and the
directory was created. But, when the perl script(containing mkdir) was
executed, it did not work.

You still haven't answered by previous question.

Post a relevant snippet of your code.
 
Q

qazmlp

Tintin said:
You still haven't answered by previous question.

Post a relevant snippet of your code.

Here is an excerpt from the script:
$opath=$ProtName;
opendir(DIR,$opath) || system("mkdir $ProtName");
closedir (DIR);

I don't know whether it helps to find the cause of the problem.

Meanwhile, the problem was solved by selecting the option,
"execute all rsh commands as user: ", for rsh in remote machine.
 
T

Tintin

qazmlp said:
Here is an excerpt from the script:
$opath=$ProtName;
opendir(DIR,$opath) || system("mkdir $ProtName");
closedir (DIR);

I don't know whether it helps to find the cause of the problem.

Meanwhile, the problem was solved by selecting the option,
"execute all rsh commands as user: ", for rsh in remote machine.

Originally, I asked:


and you answered.

Yes, you have a mkdir, but you are forking out to do something that can be
done natively in Perl (as in my example) and you have no error checking.

Use the Perl mkdir with error checking, and then see what happens.
 
B

Brian McCauley

Here is an excerpt from the script:
$opath=$ProtName;
opendir(DIR,$opath) || system("mkdir $ProtName");
closedir (DIR);

I don't know whether it helps to find the cause of the problem.

Not really. Perhaps you should replace the system("mkdir $ProtName")
with mkdir($ProtName) and then, if it fails, print out the reason that
it reports.

--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top