るりまサーチ

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

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file truncate
  4. file umask
  5. file path

検索結果

<< 1 2 > >>

File.truncate(path, length) -> 0 (62125.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
::LOCK_SH | File::LOCK_NB のように他の指定と or することで指
定します。この指定がない場合、ブロックされる条件での flock
の呼び出しはロックが解除されるまでブロックされます。

File
::LOCK_NB の指定が...

Pathname#truncate(length) -> 0 (18167.0)

File.truncate(self.to_s, length) と同じです。

...File.truncate(self.to_s, length) と同じです。


@param length 変更したいサイズを整数で与えます。

@see File.truncate...

CSV#truncate(path, length) -> 0 (18145.0)

File#truncate に委譲します。

...
File
#truncate に委譲します。


@see File#truncate...

絞り込み条件を変える

Shell#truncate(path, length) -> 0 (18135.0)

File クラスにある同名のクラスメソッドと同じです.

...
File
クラスにある同名のクラスメソッドと同じです.

@param path パスを表す文字列を指定します。

@param length 変更したいサイズを整数で与えます。

@see File.truncate...

Shell::CommandProcessor#truncate(path, length) -> 0 (18135.0)

File クラスにある同名のクラスメソッドと同じです.

...
File
クラスにある同名のクラスメソッドと同じです.

@param path パスを表す文字列を指定します。

@param length 変更したいサイズを整数で与えます。

@see File.truncate...

Shell::Filter#truncate(path, length) -> 0 (18135.0)

File クラスにある同名のクラスメソッドと同じです.

...
File
クラスにある同名のクラスメソッドと同じです.

@param path パスを表す文字列を指定します。

@param length 変更したいサイズを整数で与えます。

@see File.truncate...

NEWS for Ruby 2.5.0 (222.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()...
...* File::Stat#ino, File.identical?
Windows 8.1 以降で、ReFSの128bitのinoをサポートしました 13731
* File.readable?, File.readable_real?, File.writable?, File.writable_real?,
File
.executable?, File.executable_real?, File.mkfifo, File.readlink,
File.truncate
, File#t...
...ージはユーザーにとってわかりやすいでしょう。 13405

* Integer
* Integer#round, Integer#floor, Integer#ceil, Integer#truncate は常に Integer を返すようになりました
13420
* Integer#pow を追加 12508 11003
* Integer#allbits?, Integer#anybits?, I...

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...
<< 1 2 > >>