Sophie

Sophie

distrib > Mandriva > current > x86_64 > by-pkgid > 4eb48b954cf932f6d30c439317814ddd > files > 158

ruby1.9-doc-1.9.1.p378-3mdv2010.1.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