parrot / parrot

Parrot Virtual Machine
http://parrot.org
Artistic License 2.0
591 stars 138 forks source link

OS.cwd returns platform specific slashes... #683

Open coke opened 15 years ago

coke commented 15 years ago

... but some languages need a way to get agnostic slashes. Rather than have every HLL implement this, there should be some way to canonicalize the path, and a way to get the platform-specific path. (This will allow hlls to pick whichever method they prefer.)

I don't particularly care about the implementation, as long as I can make

C:\Tcl\bin>tclsh
% puts [pwd]
C:/Tcl/bin

work.

This issue originally opened as http://rt.perl.org/rt3/Ticket/Display.html?id=39853

Originally http://trac.parrot.org/parrot/ticket/1282

cotto commented 13 years ago

There are a few minor pitfalls, but I think this would be a good newbie ticket. Iterating over the characters should be a safe way to do this.

nolanlum commented 13 years ago

Added Parrot_lib_fix_path_slashes in a9642d402b, OS.cwd now uses this function.

Awaiting status of  Github pull request.