るりまサーチ

最速Rubyリファレンスマニュアル検索!
165件ヒット [1-100件を表示] (0.037秒)
トップページ > クエリ:path[x] > クエリ:write[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin path
  2. pathname to_path
  3. _builtin absolute_path
  4. _builtin to_path
  5. csv path

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

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

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

@see IO.write...

Gem::RequirePathsBuilder#write_require_paths_file_if_needed(spec = @spec, gem_home = @gem_home) (15202.0)

必要であれば、'.require_paths' というファイルを Gem ごとに作成します。

...必要であれば、'.require_paths' というファイルを Gem ごとに作成します。...

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

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

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


@see IO.binwrite...

Pathname#each_line(*args) -> Enumerator (3025.0)

IO.foreach(self.to_s, *args, &block) と同じです。

...ist[例][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Path
name("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Path
name("testfile").each_li...
...equire "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Path
name("testfile").each_line(4) {|f| p f }

# => "line"
# => "1\n"
# => "line"
# => "2,\n"
# => "line"
# => "3\n"
//}

//emlist[例 sep を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Path
name("t...

Pathname#each_line(*args) {|line| ... } -> nil (3025.0)

IO.foreach(self.to_s, *args, &block) と同じです。

...ist[例][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Path
name("testfile").each_line
# => #<Enumerator: IO:foreach("testfile")>
//}

//emlist[例 ブロックを指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Path
name("testfile").each_li...
...equire "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Path
name("testfile").each_line(4) {|f| p f }

# => "line"
# => "1\n"
# => "line"
# => "2,\n"
# => "line"
# => "3\n"
//}

//emlist[例 sep を指定][ruby]{
require "pathname"

IO.write("testfile", "line1\nline2,\nline3\n")
Path
name("t...

絞り込み条件を変える

Pathname#ctime -> Time (3007.0)

File.ctime(self.to_s) を渡したものと同じです。

....ctime(self.to_s) を渡したものと同じです。

//emlist[例][ruby]{
require 'pathname'

IO.write("testfile", "test")
path
name = Pathname("testfile")
path
name.ctime # => 2019-01-14 00:39:51 +0900
sleep 1
path
name.chmod(0755)
path
name.ctime # => 2019-01-14 00:39:52 +0900
//}

@see File.ctime...

IO#reopen(path) -> self (131.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...
path
で指定されたファイルにストリームを繋ぎ換えます。

第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。

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

@param mode パ...
...スを開く際のモードを文字列で指定します。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.re...

IO#reopen(path, mode) -> self (131.0)

path で指定されたファイルにストリームを繋ぎ換えます。

...
path
で指定されたファイルにストリームを繋ぎ換えます。

第二引数を省略したとき self のモードをそのまま引き継ぎます。
IO#pos, IO#lineno などはリセットされます。

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

@param mode パ...
...スを開く際のモードを文字列で指定します。

@raise Errno::EXXX 失敗した場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
f1 = File.new("testfile", "a+")
f2 = File.new("testfile")
f1.print("This is line three\n")
f2.re...

Net::HTTP#get(path, header = nil, dest = nil) -> Net::HTTPResponse (131.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...さい。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。

@param path 取得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定し...
....html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}

@see Net::HTTP#request_get...

Net::HTTP#get(path, header = nil, dest = nil) {|body_segment| .... } -> Net::HTTPResponse (131.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

...サーバ上の path にあるエンティティを取得し、
Net::HTTPResponse のインスタンスとして返します。

header が nil
でなければ、リクエストを送るときにその内容を HTTP ヘッダとして
送ります。 header は { 'Accept' = > '*/*', ... } という...
...さい。
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。

@param path 取得するエンティティのパスを文字列で指定します。
@param header リクエストの HTTP ヘッダをハッシュで指定し...
....html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/', nil) do |str|
f.write str
end
}
//}

@see Net::HTTP#request_get...

絞り込み条件を変える

<< 1 2 > >>