diff options
| author | Tomoyuki Sahara <[email protected]> | 2015-09-28 12:24:51 +0900 |
|---|---|---|
| committer | Tomoyuki Sahara <[email protected]> | 2015-09-28 12:24:51 +0900 |
| commit | 1f217ea82eea77457c69923f8946d2314e13b9ba (patch) | |
| tree | c62859b02422d5477bd54b1f0daeaed649b352ee /mrblib | |
| parent | 1d6b7f9bba247bef1da615d1c9f8d0bcc17456ea (diff) | |
| parent | 9bbfc38bb4ee3a5f66f82a68542518f397bb9897 (diff) | |
| download | mruby-1f217ea82eea77457c69923f8946d2314e13b9ba.tar.gz mruby-1f217ea82eea77457c69923f8946d2314e13b9ba.zip | |
Merge pull request #46 from takahashim/add-rewind
support IO#rewind
Diffstat (limited to 'mrblib')
| -rw-r--r-- | mrblib/io.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mrblib/io.rb b/mrblib/io.rb index 30eb47404..4d2fda5f3 100644 --- a/mrblib/io.rb +++ b/mrblib/io.rb @@ -141,6 +141,10 @@ class IO seek(i, SEEK_SET) end + def rewind + seek(0, SEEK_SET) + end + def seek(i, whence = SEEK_SET) raise IOError if closed? @pos = sysseek(i, whence) |
