Created
January 16, 2016 14:55
-
-
Save Altai-man/ea83a55ffa51ec88089a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use v6; | |
use NativeCall; | |
sub fopen(Str $filename, Str $mode) returns OpaquePointer is native() is export { * } | |
sub call(Str $way, bool $is-read) { # bool from NativeCall. | |
if $is-read { | |
fopen($way, "r"); | |
} else { | |
fopen($way, "w"); | |
} | |
} | |
call("/tmp/some", True); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment