def options_check_files(cast)
if cast[:type] == 'files!' and @options.has_key? cast[:long]
@options[cast[:long]].each do |path|
- raise ArgumentError, "No such file: '#{path}'" unless File.file? path
+ raise ArgumentError, "File not readable: '#{path}'" unless File.readable? path
end
end
end
# Class method allowing open to be used on (zipped) files.
# See File.open.
def self.open(*args)
- ios = self.zopen(*args)
+ if File.pipe? *args.first
+ ios = self.new(File.open(*args))
+ else
+ ios = self.zopen(*args)
+ end
if block_given?
begin