This is almost not a ruby question… But I need a ruby solution!
How to convert a 8.3 dos paths to its fully expanded version. For
example, how to translate:
C:\CYGWIN\HOME\MYFULL~1\MONROE~9.ALT
to
/cygdrive/c/cygwin/home/My Full Name/Monroe-Tyson.alt
The basename of this last path is relevant to me and while MONROE~9 is
unusable. cygpath -u, from the cygwin distribution, doesn’t expand the
8.3 names. It merely changes the \ into /. How fancy!
This is almost not a ruby question… But I need a ruby solution!
How to convert a 8.3 dos paths to its fully expanded version. For
example, how to translate:
C:\CYGWIN\HOME\MYFULL~1\MONROE~9.ALT
to
/cygdrive/c/cygwin/home/My Full Name/Monroe-Tyson.alt
The basename of this last path is relevant to me and while MONROE~9 is
unusable. cygpath -u, from the cygwin distribution, doesn’t expand the
8.3 names. It merely changes the \ into /. How fancy!
Any solution out there?
There’s always the “ugly” way – don’t say you heard it here.
This is almost not a ruby question… But I need a ruby solution!
How to convert a 8.3 dos paths to its fully expanded version. For
example, how to translate:
C:\CYGWIN\HOME\MYFULL~1\MONROE~9.ALT
to
/cygdrive/c/cygwin/home/My Full Name/Monroe-Tyson.alt
The basename of this last path is relevant to me and while MONROE~9 is
unusable. cygpath -u, from the cygwin distribution, doesn’t expand the
8.3 names. It merely changes the \ into /. How fancy!
Any solution out there?
There’s always the “ugly” way – don’t say you heard it here.
This is almost not a ruby question… But I need a ruby solution!
How to convert a 8.3 dos paths to its fully expanded version. For
example, how to translate:
C:\CYGWIN\HOME\MYFULL~1\MONROE~9.ALT
to
/cygdrive/c/cygwin/home/My Full Name/Monroe-Tyson.alt
The basename of this last path is relevant to me and while MONROE~9 is
unusable. cygpath -u, from the cygwin distribution, doesn’t expand the
8.3 names. It merely changes the \ into /. How fancy!
Any solution out there?
There’s always the “ugly” way – don’t say you heard it here.
This is almost not a ruby question… But I need a ruby solution!
How to convert a 8.3 dos paths to its fully expanded version. For
example, how to translate:
C:\CYGWIN\HOME\MYFULL~1\MONROE~9.ALT
to
/cygdrive/c/cygwin/home/My Full Name/Monroe-Tyson.alt
The basename of this last path is relevant to me and while MONROE~9 is
unusable. cygpath -u, from the cygwin distribution, doesn’t expand the
8.3 names. It merely changes the \ into /. How fancy!
Any solution out there?
There’s always the “ugly” way – don’t say you heard it here.
Something like:
path = cmd /c dir #{file}.split(“\n”)[6][-1]
That’s untested.
I guess I’ll settle for sliglthly improved:
path = cmd /c dir /b #{file}
The /b is the bare format: only the name.
Thanks all.
Guillaume.
Hal
If you wanna see ugly, add this to your list of possible holiday destinations: