Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > rsh & perl -Directory creation not possible

Reply
Thread Tools

rsh & perl -Directory creation not possible

 
 
qazmlp
Guest
Posts: n/a
 
      10-21-2003
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 ?
 
Reply With Quote
 
 
 
 
Gregory Toomey
Guest
Posts: n/a
 
      10-21-2003
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
 
Reply With Quote
 
 
 
 
Tintin
Guest
Posts: n/a
 
      10-21-2003

"qazmlp" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> 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?



 
Reply With Quote
 
qazmlp
Guest
Posts: n/a
 
      10-21-2003
"Tintin" <(E-Mail Removed)> wrote in message news:<bn336u$r9k3k$(E-Mail Removed)-berlin.de>...
> "qazmlp" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > 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?


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.
 
Reply With Quote
 
Roy Johnson
Guest
Posts: n/a
 
      10-21-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (qazmlp) wrote in message news:<(E-Mail Removed). com>...
> 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.
 
Reply With Quote
 
Tintin
Guest
Posts: n/a
 
      10-24-2003

"qazmlp" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> "Tintin" <(E-Mail Removed)> wrote in message

news:<bn336u$r9k3k$(E-Mail Removed)-berlin.de>...
> > "qazmlp" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed) om...
> > > 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?

>
> 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.


 
Reply With Quote
 
qazmlp
Guest
Posts: n/a
 
      10-27-2003
"Tintin" <(E-Mail Removed)> wrote in message news:<bnat60$v94hk$(E-Mail Removed)-berlin.de>...
> "qazmlp" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > "Tintin" <(E-Mail Removed)> wrote in message

> news:<bn336u$r9k3k$(E-Mail Removed)-berlin.de>...
> > > "qazmlp" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed) om...
> > > > 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?

> >
> > 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.


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.
 
Reply With Quote
 
Tintin
Guest
Posts: n/a
 
      10-28-2003

"qazmlp" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) om...
> >
> > 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.


Originally, I asked:

> > > > Does your script have something like?
> > > >
> > > > mkdir '/path/to/dir' or die "Can not mkdir /path/to/dir $!\n";



and you answered.

> > > I have mkdir command in the script.


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.


 
Reply With Quote
 
Brian McCauley
Guest
Posts: n/a
 
      10-28-2003
(E-Mail Removed) (qazmlp) writes:

> 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\\
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
perl rsh problem Rafael The Angel Perl Misc 1 11-18-2008 12:56 PM
telnet/rsh not responding jcle Cisco 0 10-13-2008 03:56 PM
RSH Hangs and does not exit in Win 2000 jordan.mccheyne@gmail.com C++ 1 06-15-2007 02:56 PM
Processes/pipes cross platform issue - popen*() hangs using "rsh/rlogin" (not working in Windows vs. Linux) David H Python 0 12-03-2004 05:37 PM
Newbie problem with perl and rsh zenshade Perl Misc 8 08-10-2004 07:02 AM



Advertisments