Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > 4fb2bf23211d5f27ae943c283575a23a > files > 158

ruby-doc-1.8.2-7.5.20060mdk.x86_64.rpm

#! /usr/bin/ruby
# convert ls-lR filename into fullpath.

if ARGV[0] =~ /-p/
  ARGV.shift
  path = ARGV.shift 
end

if path == nil
  path = ""
elsif path !~ %r|/$|
  path += "/"
end

while line = gets()
  case line
  when /:$/
    path = line.chop.chop + "/"
  when /^total/, /^d/
  when /^(.*\d )(.+)$/
    print($1, path, $2, "\n")
  end
end