<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>rubyco</author_name>
  <author_url>https://blog.hatena.ne.jp/rubyco/</author_url>
  <blog_title>rubyco（るびこ）の日記</blog_title>
  <blog_url>https://rubyco.hatenadiary.org/</blog_url>
  <categories>
  </categories>
  <description>RubyのFileを使って配列もどきを作りました。あ、でもcloseしていませんね。 書き込むときは自動的に一文字目がかかれるのに、読み出すときは明示的にchrを取らないと文字列になりません。 class FileArray def initialize(filename) @file = File.open(filename, &quot;r+&quot;) @file.binmode end def [](index) @file.seek(index) return @file.getc.chr end def []=(index, value) @file.seek(index) @file.putc(v…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Frubyco.hatenadiary.org%2Fentry%2F20060207%2Fseek&quot; title=&quot;open, binmode, seek, getc, putc - rubyco（るびこ）の日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2006-02-07 00:00:00</published>
  <title>open, binmode, seek, getc, putc</title>
  <type>rich</type>
  <url>https://rubyco.hatenadiary.org/entry/20060207/seek</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
