in reply to Re^8: Bugs in File::Find on Windows
in thread Bugs in File::Find on Windows
No, it's one command.
DOS:
>cd E:\ >cd c: C:\Work >cd c:new >cd E:\ >cd c: C:\Work\New
Perl equivalent:
print(getdcwd(), "\n"); # cd -> E:\ print(getdcwd('c:'), "\n"); # cd c: -> C:\Work { # cd c:new my $drive = substr(getcwd(), 0, 2); chdir('c:new'); chdir($drive); } print(getdcwd(), "\n"); # cd -> E:\ print(getdcwd('c:'), "\n"); # cd c: -> C:\Work\New
cd will not change the current drive.
chdir will.
I'm showing how to change the working dir on a drive without changing to that drive, like cd does.
|
|---|