{"url":"https://rubyco.hatenadiary.org/entry/20060207/seek","author_name":"rubyco","version":"1.0","image_url":null,"categories":[],"description":"Ruby\u306eFile\u3092\u4f7f\u3063\u3066\u914d\u5217\u3082\u3069\u304d\u3092\u4f5c\u308a\u307e\u3057\u305f\u3002\u3042\u3001\u3067\u3082close\u3057\u3066\u3044\u307e\u305b\u3093\u306d\u3002 \u66f8\u304d\u8fbc\u3080\u3068\u304d\u306f\u81ea\u52d5\u7684\u306b\u4e00\u6587\u5b57\u76ee\u304c\u304b\u304b\u308c\u308b\u306e\u306b\u3001\u8aad\u307f\u51fa\u3059\u3068\u304d\u306f\u660e\u793a\u7684\u306bchr\u3092\u53d6\u3089\u306a\u3044\u3068\u6587\u5b57\u5217\u306b\u306a\u308a\u307e\u305b\u3093\u3002 class FileArray def initialize(filename) @file = File.open(filename, \"r+\") @file.binmode end def [](index) @file.seek(index) return @file.getc.chr end def []=(index, value) @file.seek(index) @file.putc(v\u2026","author_url":"https://blog.hatena.ne.jp/rubyco/","title":"open, binmode, seek, getc, putc","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Frubyco.hatenadiary.org%2Fentry%2F20060207%2Fseek\" title=\"open, binmode, seek, getc, putc - rubyco\uff08\u308b\u3073\u3053\uff09\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","width":"100%","provider_url":"https://hatena.blog","published":"2006-02-07 00:00:00","type":"rich","blog_title":"rubyco\uff08\u308b\u3073\u3053\uff09\u306e\u65e5\u8a18","blog_url":"https://rubyco.hatenadiary.org/","provider_name":"Hatena Blog","height":"190"}