Skip to content

Commit

Permalink
[io grant] Implement IO::CatHandle.lock/.unlock/.seek/.tell
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed May 27, 2017
1 parent 993de50 commit 677c4ea
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/core/IO/CatHandle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,22 @@ my class IO::CatHandle is IO::Handle {
nqp::if($!active-handle, $!active-handle.path, Nil)
}
method opened(::?CLASS:D:) { nqp::p6bool($!active-handle) }
method lock {…}
method lock(::?CLASS:D: |c) {
nqp::if($!active-handle, $!active-handle.lock(|c), Nil)
}
method nl-in {…}
method seek {…}
method tell {…}
method seek(::?CLASS:D: |c) {
nqp::if($!active-handle, $!active-handle.seek(|c), Nil)
}
method tell(::?CLASS:D: --> Int:D) {
nqp::if($!active-handle, $!active-handle.tell, Nil)
}
method t (::?CLASS:D: --> Bool:D) {
nqp::if($!active-handle, $!active-handle.t, False)
}
method unlock {…}
method unlock(::?CLASS:D:) {
nqp::if($!active-handle, $!active-handle.unlock, Nil)
}
method native-descriptor (::?CLASS:D: --> Int:D) {
nqp::if($!active-handle, $!active-handle.native-descriptor, Nil)
}
Expand Down

0 comments on commit 677c4ea

Please sign in to comment.