145件ヒット
[1-100件を表示]
(0.046秒)
種類
- インスタンスメソッド (62)
- 特異メソッド (55)
- 文書 (17)
- ライブラリ (11)
ライブラリ
- ビルトイン (33)
- csv (55)
- pathname (11)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6)
クラス
- CSV (55)
- File (33)
- Pathname (11)
- Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6)
キーワード
-
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) - bigdecimal (11)
- flock (11)
- open (44)
- セキュリティモデル (2)
検索結果
先頭5件
-
File
. truncate(path , length) -> 0 (39119.0) -
path で指定されたファイルのサイズを最大 length バイト にします。
...す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "1234567890")
File.truncate("testfile", 5) # => 0
File.size("testfile") # => 5
//}... -
File
# truncate(length) -> 0 (39113.0) -
ファイルのサイズを最大 length バイトにします。
...書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX サイズの変更に失敗した場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "1234567890")
File.open("testfile", "a") do |f|
f.truncate(5) # => 0
f.size # => 5
end
//}... -
File
# flock(operation) -> 0 | false (21126.0) -
ファイルをロックします。
...をロックします。
ロックを取得するまでブロックされます。
ロックの取得に成功した場合は 0 を返します。
File::LOCK_NB (ノンブロッキング) を指定すると、本来ならブロックされる場合に
ブロックされずに false を返すよう......eration に有効な定数は以下の通りです。定数は File::Constants で定義されていますが、
File クラスの親クラスの IO が File::Constants をインクルードしているので、
これらの定数は File::LOCK_SH などとして参照可能です。
: LOCK_SH
共......いけません。
File.open("counter", File::RDWR|File::CREAT, 0644) {|f|
f.flock(File::LOCK_EX)
value = f.read.to_i + 1
f.rewind
f.write("#{value}\n")
f.flush
f.truncate(f.pos)
}
# 読み込みロック(read lock)を使用してカウンタを読み込み。
File.open("counter", "r")... -
CSV
# truncate(path , length) -> 0 (18145.0) -
File#truncate に委譲します。
...
File#truncate に委譲します。
@see File#truncate... -
Pathname
# truncate(length) -> 0 (18145.0) -
File.truncate(self.to_s, length) と同じです。
...File.truncate(self.to_s, length) と同じです。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
Shell
# truncate(path , length) -> 0 (18129.0) -
File クラスにある同名のクラスメソッドと同じです.
...
File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
Shell
:: CommandProcessor # truncate(path , length) -> 0 (18129.0) -
File クラスにある同名のクラスメソッドと同じです.
...
File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
Shell
:: Filter # truncate(path , length) -> 0 (18129.0) -
File クラスにある同名のクラスメソッドと同じです.
...
File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
NEWS for Ruby 2
. 5 . 0 (216.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...ました 11286
* File
* File.open :newline オプションを指定するとテキストモードになります 13350
* File#path はFile::Constants::TMPFILE付きで開いたファイルに対して IOError を発生させます
13568
* File.stat, File.exist? など rb_stat()......ました
13941
* File.rename GVL を解放するようになりました 13951
* File::Stat#atime, File::Stat#mtime, File::Stat#ctime
Windows 8 以降でタイムスタンプの分数表現をサポートしました 13726
* File::Stat#ino, File.identical?
Windows 8.1......た 13731
* File.readable?, File.readable_real?, File.writable?, File.writable_real?,
File.executable?, File.executable_real?, File.mkfifo, File.readlink,
File.truncate, File#truncate, File.chmod, File.lchmod, File.chown,
File.lchown, File.unlink, File.utime, File.lstat はGVL... -
CSV
. open(filename , mode = "rb" , options = Hash . new) -> CSV (148.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...ジェクトは多くのメソッドを IO や File に委譲します。
* IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File#flock
* IO#flush
* IO#fsync
* IO#intern......IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定します。
@param mode IO.open に指定できるものと同じものを指定できます。
@p.......new のオプションと同じオプションを指定できます。
//emlist[例 読み取り・ブロック指定なし][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
csv = CSV.open("test.csv... -
CSV
. open(filename , mode = "rb" , options = Hash . new) {|csv| . . . } -> nil (148.0) -
このメソッドは IO オブジェクトをオープンして CSV でラップします。 これは CSV ファイルを書くための主要なインターフェイスとして使うことを意図しています。
...ジェクトは多くのメソッドを IO や File に委譲します。
* IO#binmode
* IO#binmode?
* IO#close
* IO#close_read
* IO#close_write
* IO#closed?
* IO#eof
* IO#eof?
* IO#external_encoding
* IO#fcntl
* IO#fileno
* File#flock
* IO#flush
* IO#fsync
* IO#intern......IO#pos=
* IO#reopen
* IO#seek
* IO#stat
* StringIO#string
* IO#sync
* IO#sync=
* IO#tell
* IO#to_i
* IO#to_io
* File#truncate
* IO#tty?
@param filename ファイル名を指定します。
@param mode IO.open に指定できるものと同じものを指定できます。
@p.......new のオプションと同じオプションを指定できます。
//emlist[例 読み取り・ブロック指定なし][ruby]{
require "csv"
File.write("test.csv", <<CSV)
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
CSV
csv = CSV.open("test.csv...