Skip to content

Instantly share code, notes, and snippets.

@Altai-man
Created January 16, 2016 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Altai-man/ea83a55ffa51ec88089a to your computer and use it in GitHub Desktop.
Save Altai-man/ea83a55ffa51ec88089a to your computer and use it in GitHub Desktop.
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