what is the command to create a soft link with haskell turtle?

172 Views Asked by At

which command creates a softlink with the turtle package? there is a command to copy a file: the command cp (which is in Turtle.Prelude) but how to make a soft link, i.e. the equivalent of ln -s ?

one could use used shell or any of the related commands

shell "ln -s sourcefile target"  

does work, but i assume there is a better way!

1

There are 1 best solutions below

0
On BEST ANSWER

There is no command for this. Turtle tries to achieve portability across Windows, Linux and OS X. Creating symbolic links on Windows is restricted, so it's unlikely that a platform dependant function gets exported in Turtle's prelude.

Also, the Filesystem module used by Turtle does not expose any symlink functionality. Therefore, you have to use shell, proc or another similar function.

Alternatively, use System.Posix.Files.createSymbolicLink. You have to include unix for this, though.