Sha256: f820ce05e7387c3443ed4cb2ab6f34399a5a277ef3645cf86b5c3ad0351ff108

Contents?: true

Size: 347 Bytes

Versions: 12

Compression:

Stored size: 347 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

12 entries across 12 versions & 1 rubygems

Version Path
wixgem-0.111.0 lib/file.rb
wixgem-0.110.0 lib/file.rb
wixgem-0.108.0 lib/file.rb
wixgem-0.107.0 lib/file.rb
wixgem-0.106.0 lib/file.rb
wixgem-0.105.0 lib/file.rb
wixgem-0.104.0 lib/file.rb
wixgem-0.103.0 lib/file.rb
wixgem-0.102.0 lib/file.rb
wixgem-0.101.0 lib/file.rb
wixgem-0.100.0 lib/file.rb
wixgem-0.99.0 lib/file.rb