るりまサーチ

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

別のキーワード

  1. set new
  2. _builtin set_encoding
  3. stringio set_encoding
  4. tracer set_get_line_procs
  5. set divide

検索結果

<< 1 2 3 ... > >>

IO.write(path, string, offset=nil, **opts) -> Integer (18220.0)

path で指定されるファイルを開き、string を書き込み、 閉じます。

...らば、"|" に続くコマンドを実行し、コマンドの出力を標準出力に書き込みます。

offset を指定するとその位置までシークします。

offset を指定しないと、書き込みの末尾でファイルを
切り捨てます。

キーワード引数はフ...
...む文字列
@param offset 書き込み開始位置
@param opts ファイルを開くときのキーワード引数

//emlist[例][ruby]{
text = "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
IO.write("testfile", text) # => 66
IO.write("testfile", "0123456789",...
...20) #=> 10
IO.read("testfile")
# => "This is line one\nThi0123456789two\nThis is line three\nAnd so on...\n"
IO.write("testfile", "0123456789") #=> 10
IO.read("testfile") # => "0123456789"
//}

@see IO.binwrite...

Pathname#write(string, offset=nil, **opts) -> Integer (18213.0)

...IO.write(self.to_s, string, offset, **opts)と同じです。

@see IO.write...

IO.binwrite(path, string, offset=nil) -> Integer (6218.0)

path で指定されるファイルを開き、string を書き込み、 閉じます。

...ある点以外は IO.write と同じです。

Kernel.#open と同様 path の先頭が "|" ならば、"|" に続くコマンドを実行し、コマンドの出力を標準出力に書き込みます。

offset を指定するとその位置までシークします。

offset を指定しない...
...、書き込みの末尾でファイルを
切り捨てます。

@param path ファイル名文字列
@param string 書き込む文字列
@param offset 書き込み開始位置

//emlist[例][ruby]{
# 8x8の真っ白なPNG画像データ。
png = 'iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAAAAADhZOFXAAAADkl...
...49 48 44 52

# binwriteを使用した場合: どの環境でも正しく保存できる。
IO.binwrite('white.binmode.png', png)
puts IO.binread('white.binmode.png', 16).unpack('C*').map {|c| '%02x' % c }.join(' ')
# => 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52

# binwriteを使用しなか...

IO#pwrite(string, offset) -> Integer (6206.0)

stringをoffsetの位置にpwrite()システムコールを使って書き込みます。

...stringをoffsetの位置にpwrite()システムコールを使って書き込みます。

IO#seekとIO#writeの組み合わせと比べて、アトミックな操作に
なるという点が優れていて、複数スレッド/プロセスから同じIOオブジェクトを
様々な位置から読...
...のユーザー空間のIO層のバッファリングもバイパスします。

@param string 書き込む文字列を指定します。
@param offset ファイルポインタを変えずに書き込む位置を指定します。

@return 書き込んだバイト数を返します。

@raise Errno...
...敗した場合に発生します。
@raise NotImplementedError システムコールがサポートされていない OS で発生します。

//emlist[例][ruby]{
File.open("testfile", "w") do |f|
f.pwrite("ABCDEF", 3) # => 6
end

File.read("testfile") # => "\u0000\u0000\u0000ABCDEF"
//}...

Pathname#binwrite(string, offset=nil) -> Integer (6200.0)

IO.binwrite(self.to_s, *args)と同じです。

...IO.binwrite(self.to_s, *args)と同じです。


@see IO.binwrite...

絞り込み条件を変える

IO#set_encoding_by_bom -> Encoding | nil (6125.0)

BOM から IO のエンコーディングを設定します。

...//emlist[例][ruby]{
File.write("bom.txt", "\u{FEFF}abc")
File.open("bom.txt", "rb") do |io|
p io.set_encoding_by_bom #=> #<Encoding:UTF-8>
str = io.read
p str #=> "abc"
p str.encoding #=> #<Encoding:UTF-8>
end

File.write("nobom.txt", "abc")
File.o...
...pen("nobom.txt", "rb") do |io|
p io.set_encoding_by_bom #=> nil
end
//}...

FileTest.#setgid?(file) -> bool (6106.0)

ファイルが setgid(2) されている時に真を返 します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...ファイルが setgid(2) されている時に真を返
します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

@param file ファイル名を表す文字列か IO オブジェクトを...
...指定します。

//emlist[例][ruby]{
require 'fileutils'
IO.write("testfile", "")
FileUtils.chmod("g+s", "testfile")
FileTest.setgid?("testfile") # => true
FileUtils.chmod("g-s", "testfile")
FileTest.setgid?("testfile") # => false
//}...

FileTest.#setuid?(file) -> bool (6106.0)

ファイルが setuid(2) されている時に真を返 します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...ファイルが setuid(2) されている時に真を返
します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

@param file ファイル名を表す文字列か IO オブジェクトを...
...ト file が既に close されていた場合に発生します。

//emlist[例][ruby]{
require 'fileutils'
IO.write("testfile", "")
FileUtils.chmod("u+s", "testfile")
FileTest.setuid?("testfile") # => true
FileUtils.chmod("u-s", "testfile")
FileTest.setuid?("testfile") # => false
//}...

Win32::Registry::Constants::KEY_SET_VALUE (3103.0)

@todo

@todo

セキュリティアクセスマスク。

Win32::Registry::Constants::KEY_WRITE (3103.0)

@todo

@todo

セキュリティアクセスマスク。

絞り込み条件を変える

<< 1 2 3 ... > >>