Raku / doc

🦋 Raku documentation
https://docs.raku.org/
Artistic License 2.0
290 stars 291 forks source link

link and symlink not documented but... may be implemented? #98

Closed dha closed 9 years ago

dha commented 9 years ago

When I try to use the link() function, I get an error I didn't expect:

~/rakudostar/rakudo 18:52:05% ./perl6 -e 'link("testfile.p6", "tfile.p6");' Failed to create link called 'tfile.p6' on target '/Users/dha/rakudostar/rakudo/testfile.p6': Failed to link file: no such file or directory in any at ././CORE.setting.moarvm:1 in block at -e:1

I would have expected it to tell me it didn't recognize the function, as these aren't documented. Is it implemented? And if it is, it probably should be documented. Similarly for symlink().

Odd that it's not finding the file, though...

jonathanstowe commented 9 years ago

There are quite a few of the IO Operators that aren't documented properly. But it definitely works, I think the arguments are a different way round than you think they are:

[jonathan@coriolanus Audio-Libshout]$ perl6 -e 'link("ff", "gg")' Failed to create link called 'gg' on target '/home/jonathan/devel/perl6/Audio-Libshout/ff': Failed to link file: file already exists in any at /home/jonathan/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:1 in block at -e:1

[jonathan@coriolanus Audio-Libshout]$ rm gg [jonathan@coriolanus Audio-Libshout]$ perl6 -e 'link("ff", "gg")' Failed to create link called 'gg' on target '/home/jonathan/devel/perl6/Audio-Libshout/ff': Failed to link file: no such file or directory in any at /home/jonathan/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:1 in block at -e:1

[jonathan@coriolanus Audio-Libshout]$ perl6 -e 'link( "gg", "ff")' [jonathan@coriolanus Audio-Libshout]$ ls -al gg -rw-rw-r--. 2 jonathan jonathan 0 Jun 27 07:21 gg

(That is link($target, $source) ...)

It is implemented as $target.IO.link($source).

jonathanstowe commented 9 years ago

Added as 5e2a99284

dha commented 9 years ago

On Fri, Jun 26, 2015 at 11:28:20PM -0700, Jonathan Stowe wrote:

There are quite a few of the IO Operators that aren't documented properly. But it definitely works, I think the arguments are a different way round than you think they are:

[jonathan@coriolanus Audio-Libshout]$ perl6 -e 'link("ff", "gg")' Failed to create link called 'gg' on target '/home/jonathan/devel/perl6/Audio-Libshout/ff': Failed to link file: file already exists in any at /home/jonathan/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:1 in block at -e:1

[jonathan@coriolanus Audio-Libshout]$ rm gg [jonathan@coriolanus Audio-Libshout]$ perl6 -e 'link("ff", "gg")' Failed to create link called 'gg' on target '/home/jonathan/devel/perl6/Audio-Libshout/ff': Failed to link file: no such file or directory in any at /home/jonathan/.rakudobrew/moar-nom/install/share/perl6/runtime/CORE.setting.moarvm:1 in block at -e:1

[jonathan@coriolanus Audio-Libshout]$ perl6 -e 'link( "gg", "ff")' [jonathan@coriolanus Audio-Libshout]$ ls -al gg -rw-rw-r--. 2 jonathan jonathan 0 Jun 27 07:21 gg

(That is link($target, $source) ...)

Which is backwards, apparently, from the Perl 5 version. Important to know. Thanks.

dha

David H. Adler - dha@panix.com - http://www.panix.com/~dha/ It's just jokes, man.