[279] | 1 | mruby-io
|
---|
| 2 | ========
|
---|
[331] | 3 | [![Build Status](https://travis-ci.org/iij/mruby-io.svg?branch=master)](https://travis-ci.org/iij/mruby-io)
|
---|
[279] | 4 |
|
---|
| 5 |
|
---|
[331] | 6 | `IO` and `File` classes for mruby
|
---|
| 7 |
|
---|
[279] | 8 | ## Installation
|
---|
| 9 | Add the line below to your `build_config.rb`:
|
---|
| 10 |
|
---|
| 11 | ```
|
---|
| 12 | conf.gem :github => 'iij/mruby-io'
|
---|
| 13 | ```
|
---|
| 14 |
|
---|
| 15 | ## Implemented methods
|
---|
| 16 |
|
---|
| 17 | ### IO
|
---|
| 18 | - http://doc.ruby-lang.org/ja/1.9.3/class/IO.html
|
---|
| 19 |
|
---|
| 20 | | method | mruby-io | memo |
|
---|
| 21 | | ------------------------- | -------- | ---- |
|
---|
| 22 | | IO.binread | | |
|
---|
| 23 | | IO.binwrite | | |
|
---|
| 24 | | IO.copy_stream | | |
|
---|
| 25 | | IO.new, IO.for_fd, IO.open | o | |
|
---|
| 26 | | IO.foreach | | |
|
---|
| 27 | | IO.pipe | o | |
|
---|
| 28 | | IO.popen | o | |
|
---|
| 29 | | IO.read | o | |
|
---|
| 30 | | IO.readlines | | |
|
---|
| 31 | | IO.select | o | |
|
---|
| 32 | | IO.sysopen | o | |
|
---|
| 33 | | IO.try_convert | | |
|
---|
| 34 | | IO.write | | |
|
---|
| 35 | | IO#<< | | |
|
---|
| 36 | | IO#advise | | |
|
---|
| 37 | | IO#autoclose= | | |
|
---|
| 38 | | IO#autoclose? | | |
|
---|
| 39 | | IO#binmode | | |
|
---|
| 40 | | IO#binmode? | | |
|
---|
| 41 | | IO#bytes | | obsolete |
|
---|
| 42 | | IO#chars | | obsolete |
|
---|
| 43 | | IO#clone, IO#dup | | |
|
---|
| 44 | | IO#close | o | |
|
---|
| 45 | | IO#close_on_exec= | o | |
|
---|
| 46 | | IO#close_on_exec? | o | |
|
---|
| 47 | | IO#close_read | | |
|
---|
| 48 | | IO#close_write | | |
|
---|
| 49 | | IO#closed? | o | |
|
---|
| 50 | | IO#codepoints | | obsolete |
|
---|
| 51 | | IO#each_byte | o | |
|
---|
| 52 | | IO#each_char | o | |
|
---|
| 53 | | IO#each_codepoint | | |
|
---|
| 54 | | IO#each_line | o | |
|
---|
| 55 | | IO#eof, IO#eof? | o | |
|
---|
| 56 | | IO#external_encoding | | |
|
---|
| 57 | | IO#fcntl | | |
|
---|
| 58 | | IO#fdatasync | | |
|
---|
| 59 | | IO#fileno, IO#to_i | o | |
|
---|
| 60 | | IO#flush | o | |
|
---|
| 61 | | IO#fsync | | |
|
---|
| 62 | | IO#getbyte | | |
|
---|
| 63 | | IO#getc | o | |
|
---|
| 64 | | IO#gets | o | |
|
---|
| 65 | | IO#internal_encoding | | |
|
---|
| 66 | | IO#ioctl | | |
|
---|
[331] | 67 | | IO#isatty, IO#tty? | o | |
|
---|
[279] | 68 | | IO#lineno | | |
|
---|
| 69 | | IO#lineno= | | |
|
---|
| 70 | | IO#lines | | obsolete |
|
---|
| 71 | | IO#pid | o | |
|
---|
| 72 | | IO#pos, IO#tell | o | |
|
---|
| 73 | | IO#pos= | o | |
|
---|
| 74 | | IO#print | o | |
|
---|
| 75 | | IO#printf | o | |
|
---|
| 76 | | IO#putc | | |
|
---|
| 77 | | IO#puts | o | |
|
---|
| 78 | | IO#read | o | |
|
---|
| 79 | | IO#read_nonblock | | |
|
---|
| 80 | | IO#readbyte | | |
|
---|
| 81 | | IO#readchar | o | |
|
---|
| 82 | | IO#readline | o | |
|
---|
| 83 | | IO#readlines | o | |
|
---|
| 84 | | IO#readpartial | | |
|
---|
| 85 | | IO#reopen | | |
|
---|
| 86 | | IO#rewind | | |
|
---|
| 87 | | IO#seek | o | |
|
---|
| 88 | | IO#set_encoding | | |
|
---|
| 89 | | IO#stat | | |
|
---|
| 90 | | IO#sync | o | |
|
---|
| 91 | | IO#sync= | o | |
|
---|
| 92 | | IO#sysread | o | |
|
---|
| 93 | | IO#sysseek | o | |
|
---|
| 94 | | IO#syswrite | o | |
|
---|
| 95 | | IO#to_io | | |
|
---|
| 96 | | IO#ungetbyte | | |
|
---|
| 97 | | IO#ungetc | o | |
|
---|
| 98 | | IO#write | o | |
|
---|
| 99 | | IO#write_nonblock | | |
|
---|
| 100 |
|
---|
| 101 | ### File
|
---|
| 102 | - http://doc.ruby-lang.org/ja/1.9.3/class/File.html
|
---|
| 103 |
|
---|
| 104 | | method | mruby-io | memo |
|
---|
| 105 | | --------------------------- | -------- | ---- |
|
---|
| 106 | | File.absolute_path | | |
|
---|
| 107 | | File.atime | | |
|
---|
| 108 | | File.basename | o | |
|
---|
| 109 | | File.blockdev? | | FileTest |
|
---|
| 110 | | File.chardev? | | FileTest |
|
---|
[331] | 111 | | File.chmod | o | |
|
---|
[279] | 112 | | File.chown | | |
|
---|
| 113 | | File.ctime | | |
|
---|
| 114 | | File.delete, File.unlink | o | |
|
---|
| 115 | | File.directory? | o | FileTest |
|
---|
| 116 | | File.dirname | o | |
|
---|
| 117 | | File.executable? | | FileTest |
|
---|
| 118 | | File.executable_real? | | FileTest |
|
---|
| 119 | | File.exist?, exists? | o | FileTest |
|
---|
| 120 | | File.expand_path | o | |
|
---|
| 121 | | File.extname | o | |
|
---|
| 122 | | File.file? | o | FileTest |
|
---|
| 123 | | File.fnmatch, File.fnmatch? | | |
|
---|
| 124 | | File.ftype | | |
|
---|
| 125 | | File.grpowned? | | FileTest |
|
---|
| 126 | | File.identical? | | FileTest |
|
---|
| 127 | | File.join | o | |
|
---|
| 128 | | File.lchmod | | |
|
---|
| 129 | | File.lchown | | |
|
---|
| 130 | | File.link | | |
|
---|
| 131 | | File.lstat | | |
|
---|
| 132 | | File.mtime | | |
|
---|
| 133 | | File.new, File.open | o | |
|
---|
| 134 | | File.owned? | | FileTest |
|
---|
| 135 | | File.path | | |
|
---|
| 136 | | File.pipe? | o | FileTest |
|
---|
| 137 | | File.readable? | | FileTest |
|
---|
| 138 | | File.readable_real? | | FileTest |
|
---|
[331] | 139 | | File.readlink | o | |
|
---|
[279] | 140 | | File.realdirpath | | |
|
---|
| 141 | | File.realpath | o | |
|
---|
| 142 | | File.rename | o | |
|
---|
| 143 | | File.setgid? | | FileTest |
|
---|
| 144 | | File.setuid? | | FileTest |
|
---|
| 145 | | File.size | o | |
|
---|
| 146 | | File.size? | o | FileTest |
|
---|
| 147 | | File.socket? | o | FileTest |
|
---|
| 148 | | File.split | | |
|
---|
| 149 | | File.stat | | |
|
---|
| 150 | | File.sticky? | | FileTest |
|
---|
| 151 | | File.symlink | | |
|
---|
| 152 | | File.symlink? | o | FileTest |
|
---|
| 153 | | File.truncate | | |
|
---|
| 154 | | File.umask | o | |
|
---|
| 155 | | File.utime | | |
|
---|
| 156 | | File.world_readable? | | |
|
---|
| 157 | | File.world_writable? | | |
|
---|
| 158 | | File.writable? | | FileTest |
|
---|
| 159 | | File.writable_real? | | FileTest |
|
---|
| 160 | | File.zero? | o | FileTest |
|
---|
| 161 | | File#atime | | |
|
---|
| 162 | | File#chmod | | |
|
---|
| 163 | | File#chown | | |
|
---|
| 164 | | File#ctime | | |
|
---|
| 165 | | File#flock | o | |
|
---|
| 166 | | File#lstat | | |
|
---|
| 167 | | File#mtime | | |
|
---|
| 168 | | File#path, File#to_path | o | |
|
---|
| 169 | | File#size | | |
|
---|
| 170 | | File#truncate | | |
|
---|
| 171 |
|
---|
| 172 |
|
---|
| 173 | ## License
|
---|
| 174 |
|
---|
| 175 | Copyright (c) 2013 Internet Initiative Japan Inc.
|
---|
| 176 |
|
---|
| 177 | Permission is hereby granted, free of charge, to any person obtaining a
|
---|
| 178 | copy of this software and associated documentation files (the "Software"),
|
---|
| 179 | to deal in the Software without restriction, including without limitation
|
---|
| 180 | the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
---|
| 181 | and/or sell copies of the Software, and to permit persons to whom the
|
---|
| 182 | Software is furnished to do so, subject to the following conditions:
|
---|
| 183 |
|
---|
| 184 | The above copyright notice and this permission notice shall be included in
|
---|
| 185 | all copies or substantial portions of the Software.
|
---|
| 186 |
|
---|
| 187 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
| 188 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
| 189 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
| 190 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
---|
| 191 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
---|
| 192 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
---|
| 193 | DEALINGS IN THE SOFTWARE.
|
---|