Sha256: e4a2bcbebda7141b48fd287fed7f5314587718aa2e15be93d5df306aee6d32d1

Contents?: true

Size: 370 Bytes

Versions: 268

Compression:

Stored size: 370 Bytes

Contents

module Puppet
  Puppet::Type.type(:file).newproperty(:type) do
    require 'etc'
    desc "A read-only state to check the file type."

    def retrieve
      current_value = :absent
      stat = @resource.stat
      if stat
        current_value = stat.ftype
      end
      current_value
    end

    validate do |val|
      fail "type is read-only"
    end
  end
end

Version data entries

268 entries across 268 versions & 1 rubygems

Version Path
puppet-7.34.0 lib/puppet/type/file/type.rb
puppet-7.34.0-x86-mingw32 lib/puppet/type/file/type.rb
puppet-7.34.0-x64-mingw32 lib/puppet/type/file/type.rb
puppet-7.34.0-universal-darwin lib/puppet/type/file/type.rb
puppet-7.33.0 lib/puppet/type/file/type.rb
puppet-7.33.0-x86-mingw32 lib/puppet/type/file/type.rb
puppet-7.33.0-x64-mingw32 lib/puppet/type/file/type.rb
puppet-7.33.0-universal-darwin lib/puppet/type/file/type.rb
puppet-7.32.1 lib/puppet/type/file/type.rb
puppet-7.32.1-x86-mingw32 lib/puppet/type/file/type.rb
puppet-7.32.1-x64-mingw32 lib/puppet/type/file/type.rb
puppet-7.32.1-universal-darwin lib/puppet/type/file/type.rb
puppet-7.31.0 lib/puppet/type/file/type.rb
puppet-7.31.0-x86-mingw32 lib/puppet/type/file/type.rb
puppet-7.31.0-x64-mingw32 lib/puppet/type/file/type.rb
puppet-7.31.0-universal-darwin lib/puppet/type/file/type.rb
puppet-7.30.0 lib/puppet/type/file/type.rb
puppet-7.30.0-x86-mingw32 lib/puppet/type/file/type.rb
puppet-7.30.0-x64-mingw32 lib/puppet/type/file/type.rb
puppet-7.30.0-universal-darwin lib/puppet/type/file/type.rb