<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>round-rand</author_name>
  <author_url>https://blog.hatena.ne.jp/round-rand/</author_url>
  <blog_title>ランドML</blog_title>
  <blog_url>https://ml-rand-note.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>open：ファイルを開く 読み取り 使用するファイル read：ファイル全体を文字列として取得 readlines：全行を配列で取得 foreach：1行ずつループで処理 gets: 1行ずつ取得 getc：1文字ずつ取得 書き取り 使用するファイル ファイルを開く：open write：新規作成 or 追記(改行なし) puts：新規作成 or 追記(改行あり) 読み書き位置の移動 使用するファイル seek：バイト指定で移動 rewind：先頭に戻る 注意：モードa or a+で書き込みをする場合 参考 open：ファイルを開く openメソッドは、 第一引数：ファイル名 第二引数：モード…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fml-rand-note.hatenablog.com%2Fentry%2Fruby%2Ffile-introduction&quot; title=&quot;【Ruby】ファイル操作(read, gets, write, seekなど) - ランドML&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>2026-06-22 06:52:19</published>
  <title>【Ruby】ファイル操作(read, gets, write, seekなど)</title>
  <type>rich</type>
  <url>https://ml-rand-note.hatenablog.com/entry/ruby/file-introduction</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
