るりまサーチ

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

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

検索結果

<< 1 2 3 > >>

Shell::CommandProcessor#unlink(path) -> self (21245.0)

path がファイルなら File.unlink、path がディレクトリなら Dir.unlink の動作をします。

...path がファイルなら File.unlink、path がディレクトリなら Dir.unlink の動作をします。

@param path 削除したいパスを指定します。

@see File.unlink, Dir.unlink...

Shell#unlink(path) -> self (18245.0)

path がファイルなら File.unlink、path がディレクトリなら Dir.unlink の動作をします。

...path がファイルなら File.unlink、path がディレクトリなら Dir.unlink の動作をします。

@param path 削除したいパスを指定します。

@see File.unlink, Dir.unlink...

Shell::Filter#unlink(path) -> self (18245.0)

path がファイルなら File.unlink、path がディレクトリなら Dir.unlink の動作をします。

...path がファイルなら File.unlink、path がディレクトリなら Dir.unlink の動作をします。

@param path 削除したいパスを指定します。

@see File.unlink, Dir.unlink...

Pathname#unlink -> Integer (18107.0)

self が指すディレクトリあるいはファイルを削除します。

...self が指すディレクトリあるいはファイルを削除します。

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

pathname = Pathname("/path/to/sample")
pathname.exist? # => true
pathname.unlink # => 1
pathname.exist? # => false
//}...

File.unlink(*filename) -> Integer (15207.0)

ファイルを削除します。削除したファイルの数を返します。 削除に失敗した場合は例外 Errno::EXXX が発生します。

...

@param filename ファイル名を表す文字列を指定します。

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

//emlist[例][ruby]{
IO.write("test.txt", "test")
p File.exist?("test.txt") # => true
p File.delete("test.txt") # => 1
p File.exist?("test.txt") # => false
beg...
...in
File.delete("test.txt")
rescue
p $! # => #<Errno::ENOENT: No such file or directory @ unlink_internal - test.txt>
end
//}...

絞り込み条件を変える

Dir.unlink(path) -> 0 (15201.0)

ディレクトリを削除します。ディレクトリは空でなければいけませ ん。ディレクトリの削除に成功すれば 0 を返します。

...リは空でなければいけませ
ん。ディレクトリの削除に成功すれば 0 を返します。

@param path ディレクトリのパスを文字列で指定します。

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

//emlist[例][ruby]{
Dir.delete("/tmp/hoge-jbrYBh.tmp")...

Pathname#cleanpath(consider_symlink = false) -> Pathname (9106.0)

余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

...余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

cleanpath は、実際にファイルシステムを参照することなく、文字列操作
だけで処理を行います。

@param consider_symlink 真ならパス要素にシンボリック...
...st[例][ruby]{
require "pathname"
path = Pathname.new("//.././../")
path # => #<Pathname://.././../>
path.cleanpath # => #<Pathname:/>


require 'pathname'
Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil
Dir.m...
...kdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/../bar")
Dir.chdir("/tmp")

path.cleanpath # => #<Pathname:bar/bar>
path.cleanpath(true) # => #<Pathname:bar/foo/../bar>
//}...

Pathname#realpath -> Pathname (9106.0)

余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

...Pathname オブジェクトを返します。

また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。

self が指すパスが存在しない場合は例外 Errno::ENOENT が発生します。

@param ba...
...uire 'pathname'

Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil

Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/../bar")

Dir.chdir("/tmp")

p path.realpath

# =...
...> ruby 1.8.0 (2003-10-10) [i586-linux]
# #<Pathname:/tmp/bar>
//}

@see Pathname#realdirpath, File.realpath...

Pathname#realpath(basedir = nil) -> Pathname (9106.0)

余計な "."、".." や "/" を取り除いた新しい Pathname オブジェクトを返します。

...Pathname オブジェクトを返します。

また、ファイルシステムをアクセスし、実際に存在するパスを返します。
シンボリックリンクも解決されます。

self が指すパスが存在しない場合は例外 Errno::ENOENT が発生します。

@param ba...
...uire 'pathname'

Dir.rmdir("/tmp/foo") rescue nil
File.unlink("/tmp/bar/foo") rescue nil
Dir.rmdir("/tmp/bar") rescue nil

Dir.mkdir("/tmp/foo")
Dir.mkdir("/tmp/bar")
File.symlink("../foo", "/tmp/bar/foo")
path = Pathname.new("bar/././//foo/../bar")

Dir.chdir("/tmp")

p path.realpath

# =...
...> ruby 1.8.0 (2003-10-10) [i586-linux]
# #<Pathname:/tmp/bar>
//}

@see Pathname#realdirpath, File.realpath...

FileUtils.#safe_unlink(list, options = {}) -> () (6201.0)

FileUtils.rm(list, force: true) と同じです。

...@param list 削除する対象。一つの場合は文字列も指定可能です。
二つ以上指定する場合は配列で指定します。

@param options :noop, :verbose が指定できます。
:force がセットされた場合は作業中すべての StandardE...

絞り込み条件を変える

<< 1 2 3 > >>