るりまサーチ

最速Rubyリファレンスマニュアル検索!
54件ヒット [1-54件を表示] (0.020秒)

別のキーワード

  1. etc passwd
  2. passwd each
  3. etc passwd=
  4. passwd dir=

ライブラリ

クラス

モジュール

キーワード

検索結果

Etc::Passwd#dir -> String (21101.0)

このユーザのホームディレクトリを表すパスを返します。

このユーザのホームディレクトリを表すパスを返します。

Etc::Passwd#dir=(dir) (9202.0)

このユーザのホームディレクトリを表すパスを設定します。

このユーザのホームディレクトリを表すパスを設定します。

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

ファイルがディレクトリの時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...ブジェクト file が既に close されていた場合に発生します。

例:
FileTest.directory?('/etc') # => true
FileTest.directory?('/etc/passwd') # => false

f = File.open('/etc')
FileTest.directory?(f) # => true
f.close
FileTest.directory?(f) # => IOError: closed stream...

Etc::Passwd (6012.0)

Etc.#getpwent で得られる構造体。

...変更してもシステムには反映されません。

全てのシステムで提供されているメンバ。
* name
* passwd
* uid
* gid
* gecos
* dir
* shell

以降のメンバはシステムによっては提供されません。
* change
* quota
* age
* class
* co...

shell (90.0)

Ruby 上で sh/csh のようにコマンドの実行及びフィルタリングを手軽に行うためのライブラリです。

...Example 1:

require 'shell'
sh = Shell.cd("/tmp")
sh.mkdir "shell-test-1" unless sh.exists?("shell-test-1")
sh.cd("shell-test-1")
for dir in ["dir1", "dir3", "dir5"]
unless sh.exists?(dir)
sh.mkdir dir
sh.cd(dir) do
f = sh.open("tmpFile", "w")
f.puts "TEST"...
...require 'shell'
sh = Shell.cd("/tmp")
sh.transact do
mkdir "shell-test-1" unless exists?("shell-test-1")
cd("shell-test-1")
for dir in ["dir1", "dir3", "dir5"]
if !exists?(dir)
mkdir dir
cd(dir) do
f = open("tmpFile", "w")
f.print "TEST\n"...
...> "tee2"
(sh.cat < "/etc/printcap") | sh.tee("tee11") > "tee12"
sh.cat("/etc/printcap") | sh.tee("tee1") >> "tee2"
(sh.cat < "/etc/printcap") | sh.tee("tee11") >> "tee12"

==== Example 4:

require 'shell'
sh = Shell.new
print sh.cat("/etc/passwd").head.collect {|line| /keiju/ =~ line }...

絞り込み条件を変える