590件ヒット
[501-590件を表示]
(0.065秒)
別のキーワード
クラス
- CSV (48)
- File (12)
- IO (226)
- Method (14)
- Module (12)
-
Net
:: HTTP (48) -
Net
:: HTTPResponse (24) - Object (12)
- OptionParser (12)
- Proc (14)
-
Rake
:: FileList (96) -
Rake
:: FileTask (12) -
Rake
:: PackageTask (24) -
Zlib
:: GzipWriter (24)
モジュール
-
Rake
:: TaskManager (12)
キーワード
- << (26)
- >> (14)
-
add
_ row (12) -
attr
_ writer (12) - clone (12)
- close (12)
-
close
_ read (12) -
close
_ write (12) - display (12)
- dup (12)
-
each
_ byte (24) -
each
_ codepoint (24) - egrep (12)
-
excluded
_ from _ list? (12) - existing (12)
- existing! (12)
- ext (12)
- fcntl (12)
- finish (12)
- get (24)
- gsub! (12)
- import (12)
-
internal
_ encoding (12) - load (12)
- needed? (12)
-
package
_ files (12) -
package
_ files= (12) - pos (12)
- pos= (12)
- post (24)
- pread (8)
- puts (12)
- pwrite (8)
-
read
_ body (24) - readbyte (12)
- resolve (12)
-
set
_ encoding _ by _ bom (6) - stat (12)
-
synthesize
_ file _ task (12) - syswrite (12)
- tell (12)
- truncate (12)
-
write
_ headers? (12)
検索結果
先頭5件
-
IO
# pread(maxlen , offset , outbuf = "") -> string (25.0) -
preadシステムコールを使ってファイルポインタを変更せずに、また現在のファイルポインタに 依存せずにmaxlenバイト読み込みます。
...ない OS で発生します。
//emlist[例][ruby]{
File.write("testfile", "This is line one\nThis is line two\n")
File.open("testfile") do |f|
p f.read # => "This is line one\nThis is line two\n"
p f.pread(12, 0) # => "This is line"
p f.pread(9, 8) # => "line one\n"
end
//}... -
IO
# stat -> File :: Stat (25.0) -
ファイルのステータスを含む File::Stat オブジェクトを生成して 返します。
...に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two\n")
File.open("testfile") do |f|
s = f.stat
"%o" % s.mode # => "100644"
s.blksize # => 4096
s.atime # => 2018-03-01 23:19:59 +0900
end
//}
@see File#lstat, File.stat, File.l... -
IO
# tell -> Integer (25.0) -
ファイルポインタの現在の位置を整数で返します。
...タの現在の位置を整数で返します。
@raise IOError 既に close されている場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "This is line one\n")
File.open("testfile") do |f|
f.pos # => 0
f.gets # => "This is line one\n"
f.pos # => 17
end
//}... -
Net
:: HTTP # get(path , header = nil , dest = nil) -> Net :: HTTPResponse (25.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...応じて例外が発生します。
また、返り値が [レスポンスオブジェクト, そのボディ] となります。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.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 (25.0) -
サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。
...応じて例外が発生します。
また、返り値が [レスポンスオブジェクト, そのボディ] となります。
//emlist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.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... -
OptionParser
# load(filename = nil) -> bool (25.0) -
指定された filename を読み込んで各行をまとめたものに対して OptionParser#parse を行ないます。
...例][ruby]{
require "optparse"
IO.write("options.txt", %w(-a --b).join("\n"))
options = { a: false, b: false }
OptionParser.new do |opt|
opt.on('-a') { |v| options[:a] = v }
opt.on('--b') {|v| options[:b] = v }
opt.load("options.txt") # => true
opt.load("not_exist.txt") # => false
end
p... -
Rake
:: FileTask # needed? -> bool (25.0) -
このタスクが必要である場合は真を返します。 そうでない場合は偽を返します。
...るファイルが古い場合に真を返します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: "test.txt"
file "test.txt" do |task|
Rake.application.options.build_all = false
task.needed? # => true
IO.write("test.txt", "test")
task.needed? # => false
end
//}... -
Rake
:: TaskManager # synthesize _ file _ task(task _ name) -> Rake :: FileTask | nil (25.0) -
与えられたタスク名をもとにファイルタスクを合成します。
...][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do |task|
task.application.synthesize_file_task("sample_file") # => nil
IO.write("sample_file", "")
task.application.synthesize_file_task("sample_file") # => <Rake::FileTask sample_file => []>
end
/...