Sha256: 17cd46f661cf65cb60251295c2c756c0c594f7d124fd55a08ced4af323e8c577

Contents?: true

Size: 341 Bytes

Versions: 13

Compression:

Stored size: 341 Bytes

Contents

require 'win32ole'

class File
  def self.read_only?(path)
    raise "'#{path}' does not exist" unless(File.exists?(path))
	
	fso = WIN32OLE.new('Scripting.FileSystemObject')
    raise 'Failed to create Scripting.FileSystemObject' if(fso.nil?)
	fo = fso.GetFile(path)
	
	return ((fo.Attributes & 1) != 0) ? true : false
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wixgem-0.93.0 lib/file.rb
wixgem-0.90.0 lib/file.rb
wixgem-0.89.0 lib/file.rb
wixgem-0.88.0 lib/file.rb
wixgem-0.87.0 lib/file.rb
wixgem-0.85.0 lib/file.rb
wixgem-0.84.0 lib/file.rb
wixgem-0.66.0 lib/file.rb
wixgem-0.65.0 lib/file.rb
wixgem-0.64.0 lib/file.rb
wixgem-0.63.0 lib/file.rb
wixgem-0.62.0 lib/file.rb
wixgem-0.59.0 lib/file.rb