Opened 6 years ago

Last modified 5 years ago

#187 new defect

File::Spec->rel2abs gets current working dfirectory for wrong drive

Reported by: Shmuel (Seymour J.) Metz Owned by:
Priority: Feedback pending Milestone:
Component: *none Version:
Severity: medium Keywords: Perl, CWD, File::Spec
Cc:

Description

A call to File::Spec->rel2abs with an explicit drives returns a file specification with the CWD of the current drive instead of the CWD of the specified drive. See

http://mantis.smedley.id.au/view.php?id=543
https://rt.cpan.org/Public/Bug/Display.html?id=75319

I currently have a partial power outage and can't test Cwd->abs_path against your build.

Attachments (3)

testrel2abs.cmd (1.0 KB) - added by Shmuel (Seymour J.) Metz 6 years ago.
Script to run test program with messages showing expected results
testrel2abs.pl (1.4 KB) - added by Shmuel (Seymour J.) Metz 6 years ago.
Perl program to demonstrate errors
cwd.note (5.2 KB) - added by Shmuel (Seymour J.) Metz 4 years ago.
Implementation notes on suggested fix - somewhat dated, but the OS/2 API hasn't changed

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by Shmuel (Seymour J.) Metz

Attachment: testrel2abs.cmd added

Script to run test program with messages showing expected results

Changed 6 years ago by Shmuel (Seymour J.) Metz

Attachment: testrel2abs.pl added

Perl program to demonstrate errors

comment:1 Changed 5 years ago by Silvan Scherrer

Priority: minorFeedback pending

please verify against win or linux and see how it behaves there.

comment:2 Changed 5 years ago by Shmuel (Seymour J.) Metz

There is no syntax for drive in Linux. As for windows, File::Spec::Win32 has code that should work, as noted in https://rt.cpan.org/Public/Bug/Display.html?id=75319:

"The logic for in File::Spec::Win32 is applicable to OS/2, although the
API is different. Also, in OS/2 the expression CMD /c CD $drive: will
return the current directory for drive $drive.

I'm not sure whether it is best to copy code from File::Spec::Win32 into
File::Spec::OS2, subclass it or to make explicit calls to the win32
versions of various routines. I'm also not sure whether performance will
be adequate using the CD hack above or whether the XS code is really
needed. I can attempt to put a fix together if someone can provide style
guidance and help with the XS."

Changed 4 years ago by Shmuel (Seymour J.) Metz

Attachment: cwd.note added

Implementation notes on suggested fix - somewhat dated, but the OS/2 API hasn't changed

Note: See TracTickets for help on using tickets.