haskell / directory

Platform-independent library for basic file system operations
https://hackage.haskell.org/package/directory
Other
58 stars 47 forks source link

makeAbsolute ~ gives wrong path #150

Closed Vic-M closed 1 year ago

Vic-M commented 1 year ago

Running makeAbsolute ~/path/to/a gives /home/user/current/directory/~/path/to/a instead of /home/user/path/to/a. Is this the intended behavior?

Additional details I'm using Windows WSL2.

Rufflewind commented 1 year ago

Tilde expansion is a feature of the shell.

Tildes are not treated specially by makeAbsolute; it simply interprets them as literal tilde characters.

You might want to look for another library that offers tilde expansion.

Vic-M commented 1 year ago

Thanks for the reply. I'm not sure if any other libraries convert ~ but it should be simple enough to replace it using System.Directory's getHomeDirectory.