るりまサーチ

最速Rubyリファレンスマニュアル検索!
44件ヒット [1-44件を表示] (0.028秒)
トップページ > クエリ:File[x] > クエリ:IO[x] > クエリ:existing[x]

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file ctime
  4. file atime
  5. file lstat

ライブラリ

クラス

キーワード

検索結果

Rake::FileList#existing -> Rake::FileList (21231.0)

自身に含まれるファイルのうちファイルシステムに存在するファイルのみを 含む Rake::FileList を返します。

...む Rake::FileList を返します。

//emlist[][ruby]{
# Rakefile での記載例とする

IO
.write("test1.rb", "test")
IO
.write("test2.rb", "test")

task default: :test_rake_app
task :test_rake_app do
file
_list = FileList.new("test1.rb", "test2.rb", "test3.rb")
file
_list.existing # => ["test...

Rake::FileList#existing! -> self (9137.0)

自身に含まれるファイルのうちファイルシステムに存在するファイルのみを 含むように自身を変更して返します。

...ist[][ruby]{
# Rakefile での記載例とする

IO
.write("test1.rb", "test")
IO
.write("test2.rb", "test")

task default: :test_rake_app
task :test_rake_app do
file
_list = FileList.new("test1.rb", "test2.rb", "test3.rb")
file
_list.existing! # => ["test1.rb", "test2.rb"]
file
_list #...

ruby 1.8.4 feature (324.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...ture/test [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>))
* ((<ruby 1.8.4 feature/FileTest.identical? [new]>))
* ((<ruby 1.8.4 feature/File.split [change]>))
* ((<ruby 1.8.4 feature/File.basename [change]>))
* ((<ruby 1.8.4 feature/File.dirname [change]>))
* ((<ruby 1.8.4 featu...
...re/File::Stat#pipe? [bug]>))
* ((<ruby 1.8.4 feature/Array#fill [bug]>))
* ((<ruby 1.8.4 feature/String#scan [bug]>))
* ((<ruby 1.8.4 feature/File.join [bug]>))
* ((<ruby 1.8.4 feature/Thread#pass [bug]>))
* ((<ruby 1.8.4 feature/Module#const_missing [bug]>))
* ((<ruby 1.8.4 feature/IO [...
...23:46:35 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * lib/find.rb (Find::find): should not ignore symbolic links to
# non-existing files. [ruby-talk:165866]

broken symbolic link(存在しないファイルに対するシンボリックリン
ク)も返すようにな...

CSV (36.0)

このクラスは CSV ファイルやデータに対する完全なインターフェイスを提供します。

...ターフェイスを提供します。

=== 読み込み

//emlist[][ruby]{
require "csv"

csv_text = <<~CSV_TEXT
Ruby,1995
Rust,2010
CSV_TEXT

IO
.write "sample.csv", csv_text

# ファイルから一行ずつ
CSV.foreach("sample.csv") do |row|
p row
end
# => ["Ruby", "1995"]
# ["Rust", "2...
...)
# => [["Ruby", "1995"], ["Rust", "2010"]]
//}

=== 書き込み

//emlist[][ruby]{
require 'csv'

# ファイルへ書き込み
CSV.open("path/to/file.csv", "wb") do |csv|
csv << ["row", "of", "CSV", "data"]
csv << ["another", "row"]
# ...
end

# 文字列へ書き込み
csv_string = CSV.gen...
...ethods that allow you to open IO objects (CSV::foreach(), CSV::open(),
CSV::read(), and CSV::readlines()) do allow you to specify the Encoding.

One minor exception comes when generating CSV into a String with an Encoding
that is not ASCII compatible. There's no existing data for CSV to use to
prep...