[comp.lang.perl] MS-DOS version questions

andyd@pogo.WV.TEK.COM (Andy Davidson) (09/14/90)

Is there a way in the MS-DOS version of perl to

    1. chdir to another drive?  If I do
            chdir("d:/stuff") || die "Couldn't chdir: $!";
       I get no error, but neither does the chdir take effect.
       If the line instead is
            chdir("/stuff") || die "Couldn't chdir: $!";
       (note no "d:"), then the chdir takes effect, but on the
       current disk, of course.

    2. get the effect of cbreak?  I need to get and react to single
       character input without requiring a <return> be entered.


       thanks,

            andy

    Andy Davidson    Toolsmith-in-residence    Tektronix     503-685-3033
       Internet: andyd@pogo.WV.tek.com     uucp: ...!tektronix!pogo!andyd
            

-- 
    Andy Davidson    Toolsmith-in-residence    Tektronix     503-685-3033
       Internet: andyd@pogo.WV.tek.com     uucp: ...!tektronix!pogo!andyd

news@usc.edu (09/16/90)

In article <9821@pogo.WV.TEK.COM> andyd@pogo.WV.TEK.COM (Andy
Davidson) writes: 
   Is there a way in the MS-DOS version of perl to

       1. chdir to another drive?  If I do
	       chdir("d:/stuff") || die "Couldn't chdir: $!";
	  I get no error, but neither does the chdir take effect.

Um, I don't have an msdos perl workin, but come on!!  You know that
chdir on messydos is independent of the default drive....

try following the above line with something like
               system("d:") || die "Couldn't switch drives: $!";

roy%cybrspc@cs.umn.edu (Roy M. Silvernail) (09/17/90)

news@usc.edu writes:

[regarding chdir() on MS-DOS]
> Um, I don't have an msdos perl workin, but come on!!  You know that
> chdir on messydos is independent of the default drive....
> 
> try following the above line with something like
>                system("d:") || die "Couldn't switch drives: $!";

Hoo-boy! I think it's time for a chdsk() to be added to the MS-DOS
version. system() will spawn a new command processor for the job, which
will slow things down a lot. (especially if you run 4dos and your
COMSPEC=C:\4DOS.COM)
--
Roy M. Silvernail |+|  roy%cybrspc@cs.umn.edu  |+| #define opinions ALL_MINE;
main(){float x=1;x=x/50;printf("It's only $%.2f, but it's my $%.2f!\n",x,x);}
"This is cyberspace." -- Peter da Silva  :--:  "...and I like it here!" -- me

tell@oscar.cs.unc.edu (Stephen Tell) (09/17/90)

In article <PPPLP1w163w@cybrspc> roy%cybrspc@cs.umn.edu (Roy M. Silvernail) writes:
>news@usc.edu writes:
>
>[regarding chdir() on MS-DOS]
>> Um, I don't have an msdos perl workin, but come on!!  You know that
>> chdir on messydos is independent of the default drive....
>> 
>Hoo-boy! I think it's time for a chdsk() to be added to the MS-DOS
>version....

I note that there is a precedent for the former operation though.  The 
builtin "cd" on the MKS Toolkit shell works the way the original poster
expected; "cd d:/usr/sgt" is probably translated into DOS system calls to
change both directory and drive.  I find this *MUCH* more intuitive than
the old Dos way of doing things.  I think the old DOS way was a hack so
old dos 1.0 programs would have an easier time running on dos 2.0 (which
added directories).

Disclaimer:  I only use DOS when I have to, and MKS makes it bearable.
I'm still waiting for the Amiga-perl someone is working on.

BTW, where can I ftp DOS-perl from?

>Roy M. Silvernail |+|  roy%cybrspc@cs.umn.edu  |+| #define opinions ALL_MINE;

--------------------------------------------------------------------
Steve Tell      e-mail: tell@wsmail.cs.unc.edu usmail:  #5L Estes Park apts
CS Grad Student, UNC Chapel Hill.                       Carrboro NC 27510