1998-01-16 15:13:05 +03:00
|
|
|
#! /usr/local/bin/ruby
|
|
|
|
# convert ls-lR filename into fullpath.
|
|
|
|
|
|
|
|
if ARGV[0] =~ /-p/
|
|
|
|
ARGV.shift
|
|
|
|
path = ARGV.shift
|
|
|
|
end
|
|
|
|
|
|
|
|
if path == nil
|
|
|
|
path = ""
|
2000-12-28 08:00:47 +03:00
|
|
|
elsif path !~ %r|/$|
|
1998-01-16 15:13:05 +03:00
|
|
|
path += "/"
|
|
|
|
end
|
|
|
|
|
2000-12-28 08:00:47 +03:00
|
|
|
while line = gets()
|
|
|
|
case line
|
|
|
|
when /:$/
|
2002-12-19 23:39:26 +03:00
|
|
|
path = line.chop.chop + "/"
|
2000-12-28 08:00:47 +03:00
|
|
|
when /^total/, /^d/
|
|
|
|
when /^(.*\d )(.+)$/
|
1998-01-16 15:13:05 +03:00
|
|
|
print($1, path, $2, "\n")
|
|
|
|
end
|
|
|
|
end
|