Skip to content
Daniel Berger edited this page Jan 31, 2016 · 3 revisions

The win32-file-security gem is a Ruby library that both adds new methods to the core File class for Ruby, and replaces certain methods that are unimplemented (or poorly implemented) on Microsoft Windows.

As the name implies, this gem will only work on Windows, and then only on Windows 7 or Windows 2008 Server, or later. Earlier versions of Windows, including Windows XP and Windows 2003 Server, are not supported. Generally speaking, once Microsoft drops support for an operating system, then so do I.

The singleton methods overriden by this gem are:

  • chown
  • grpowned?
  • owned?

These methods either don't work or return bogus results in core Ruby, which generally assumes Unix user/group/world style permissions. Because Windows uses security descriptors to handle permissions, these required redefinition.

New singleton methods that were added to the File class by this gem are:

  • decrypt
  • encrypt
  • encryption_status
  • encryptable?
  • get_permissions
  • group
  • owner
  • securities
  • set_permissions
  • supports_acls?
Clone this wiki locally