Open kevmoo opened 10 years ago
I agree that this should be part of dart:io, since the rules for expanding path shorthand very system-dependent and often complicated.
Removed Area-IO label. Added Library-IO label.
I'm calling this a P3 because it is possible for Dart developers to implement this themselves or for it to be implemented as a separate package.
Ran into this again today. It feels like something from an official Dart library should provide some way to expand ~ in a path since on Mac/Linux that's a common shorthand. But maybe it's not as common as I think?
I naively use ~/tmp_output or similar a lot across commands.
But when I try with Dart commands, I end up creating a '~' directory in the working directory -- hilariously followed by a quite naive 'rm -rf ~'. A really great morning.
It'd be good to make it trivial to use standard path notation in the shell.
Python's implementations look like great inspiration
https://docs.python.org/2/library/os.path.html#os.path.expanduser https://docs.python.org/2/library/os.path.html#os.path.expandvars
This is related to https://code.google.com/p/dart/issues/detail?id=2930 for VM command line options
Perhaps we could hack this together in pkg/path -- but I feel it belongs in dart:io. Platform, perhaps?