View Issue Details

IDProjectCategoryView StatusLast Update
0000521Perl for OS/2Bugpublic2020-08-31 10:00
Reportershmuel Assigned Topsmedley  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformAMD dual coreOSeComStationOS Version2.0 GA
Summary0000521: File::Spec->rel2abs gets current working dfirectory for wrong drive
DescriptionIf a file specifies a drvie and a relative path, File::Spec->rel2abs appends the current directory for the current drive instead of for the specified drive. This was fixed for win32 but not for OS/2.
Steps To ReproduceRevise the code below to reflect the drive that you will be running it from. Change the working directory for that drive, and make a different drive current. Change the working directory for the current drive to any directory that doesn't have the same name as the program directory.

use File::Spec;
print "\nFile::Spec->rel2abs(testpl.cmd) = ", File::Spec->rel2abs('H:testpl.cmd');
Additional InformationNeeds OS/2 code similar to the win32 code in cwd.pm, cwd.xs and File\Spec\OS2.pm to call DosQueryCurrentDir.
TagsNo tags attached.
Attached Files
testrel2abs.cmd (295 bytes)
testrel2abs.pl (103 bytes)

Activities

psmedley

2012-01-22 08:47

administrator   ~0002187

I've made some changes to try and make OS/2 behave like win32.

Bear in mind I know NOTHING about perl syntax - can you provide me a simple testcase to test the code?

Sorry but I don't understand what the above code is supposed to output

shmuel

2012-01-22 13:11

reporter   ~0002189

use File::Spec;
print "\nFile::Spec->rel2abs(H:testpl.cmd) = ", File::Spec->rel2abs('H:testpl.cmd');

should display the complete path for test.pl in the current working directoy of H:. To set it, change the code to specify a drive that exists on your system, set a working directory on that drive, change to a different drive and set a different directory on that drive. The current File::Spec->rel2abs allegedly works correctly in windoze, displaying the path with the current working directory for the specified drive, but in OS/2 it uses the current directory for the current drive.

psmedley

2012-01-26 08:12

administrator   ~0002196

I think this is fixed in my latest build:

perl is in u:\perl5

telrel2abs.pl is run from e:\downloads & the output is:

[E:\downloads]perl testrel2abs.pl

File::Spec->rel2abs(F:testpl.cmd) = E:/downloads/testpl.cmd

psmedley

2012-01-26 08:14

administrator   ~0002197

New test build is at http://smedley.id.au/perl-5.14.2-os2-20120126.zip

psmedley

2012-01-26 08:19

administrator   ~0002200

I didn't read your report fully, seems it is NOT fixed

shmuel

2012-03-06 22:01

reporter   ~0002223

See <https://rt.cpan.org/Public/Bug/Display.html?id=75319>; I'm considering trying to work up a fix but I'm not comfortable with XS.

psmedley

2012-03-16 01:53

administrator   ~0002224

I wonder if this is related to http://svn.netlabs.org/libc/ticket/237#comment:8

shmuel

2012-03-16 17:58

reporter   ~0002225

No, the problem is definitely in the Perl code for PathTools. I haven't gotten any feedback in <https://rt.cpan.org/Public/Bug/Display.html?id=75319>, so I'll probably hack a fix and see if they accept it.

psmedley

2020-08-31 10:00

administrator   ~0003528

This should be fixed in latest Perl/2 builds

Issue History

Date Modified Username Field Change
2012-01-19 11:53 shmuel New Issue
2012-01-22 08:47 psmedley Note Added: 0002187
2012-01-22 13:11 shmuel Note Added: 0002189
2012-01-22 13:13 shmuel File Added: testrel2abs.cmd
2012-01-22 13:13 shmuel File Added: testrel2abs.pl
2012-01-26 08:12 psmedley Note Added: 0002196
2012-01-26 08:14 psmedley Note Added: 0002197
2012-01-26 08:19 psmedley Note Added: 0002200
2012-03-06 22:01 shmuel Note Added: 0002223
2012-03-16 01:53 psmedley Note Added: 0002224
2012-03-16 17:58 shmuel Note Added: 0002225
2020-08-31 10:00 psmedley Assigned To => psmedley
2020-08-31 10:00 psmedley Status new => closed
2020-08-31 10:00 psmedley Resolution open => fixed
2020-08-31 10:00 psmedley Note Added: 0003528