Project

General

Profile

Actions

Feature #2324

open

Dir instance methods for relative path

Added by nobu (Nobuyoshi Nakada) over 14 years ago. Updated over 6 years ago.

Status:
Assigned
Target version:
-
[ruby-dev:39606]

Description

なかだです。

http://www.ipa.go.jp/security/fy20/reports/tech1-tg/2_05.html
みて思い出したんですが、相対パスを使うDirのインスタンスメソッド
はどうでしょうか。実装はmvmブランチにあります。

$ ./ruby -v -e 'p Dir.open("ext"){|d|d.open("extmk.rb"){|f|f.gets}}'
ruby 1.9.1 (2008-12-25 mvm 20976) [i686-linux]
"#! /usr/local/bin/ruby\n"

$ mkdir tmp
$ touch tmp/x tmp/y
$ ./ruby -e 'p Dir.open("tmp"){|d|d.unlink("x")}'
0
$ ls tmp/
y

--
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
中田 伸悦


Related issues 2 (1 open1 closed)

Related to Ruby master - Feature #10181: New method File.openat()OpenActions
Has duplicate Ruby master - Feature #2325: Dir instance methods for relative pathClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0