Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > e00f75691700f74a1a61d86cd41b9c86 > files > 14

squirrelsh-doc-1.2.7-11.mga7.armv7hl.rpm

#!/usr/bin/ruby

# List directory contents.

path = ARGV[0] == nil ? "." : ARGV[0].dup

# Remove trailing slashes
while path =~ /\/$/
	path.chop!
end

entries = Dir.open(path)
for entry in entries
	unless entry == "." || entry == ".."
		filePath	= "#{path}/#{entry}"
		fileStat = File.stat(filePath)
		if fileStat.directory?
			puts "dir : #{filePath}"
		elsif fileStat.file?
			puts "file: #{filePath}"
		end
	end
end
entries.close()