Sha256: 84b6a311e4fadc57a5e2c3e539e268517fd2c5aa09a09ee4a4b97add72b75f0e

Contents?: true

Size: 400 Bytes

Versions: 20

Compression:

Stored size: 400 Bytes

Contents

# frozen_string_literal: true
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

20 entries across 20 versions & 1 rubygems

Version Path
puppet-8.3.0 lib/puppet/type/file/type.rb
puppet-8.3.0-x86-mingw32 lib/puppet/type/file/type.rb
puppet-8.3.0-x64-mingw32 lib/puppet/type/file/type.rb
puppet-8.3.0-universal-darwin lib/puppet/type/file/type.rb
puppet-8.3.1 lib/puppet/type/file/type.rb
puppet-8.3.1-x86-mingw32 lib/puppet/type/file/type.rb
puppet-8.3.1-x64-mingw32 lib/puppet/type/file/type.rb
puppet-8.3.1-universal-darwin lib/puppet/type/file/type.rb
puppet-8.2.0 lib/puppet/type/file/type.rb
puppet-8.2.0-x86-mingw32 lib/puppet/type/file/type.rb
puppet-8.2.0-x64-mingw32 lib/puppet/type/file/type.rb
puppet-8.2.0-universal-darwin lib/puppet/type/file/type.rb
puppet-8.1.0 lib/puppet/type/file/type.rb
puppet-8.1.0-x86-mingw32 lib/puppet/type/file/type.rb
puppet-8.1.0-x64-mingw32 lib/puppet/type/file/type.rb
puppet-8.1.0-universal-darwin lib/puppet/type/file/type.rb
puppet-8.0.1 lib/puppet/type/file/type.rb
puppet-8.0.1-x86-mingw32 lib/puppet/type/file/type.rb
puppet-8.0.1-x64-mingw32 lib/puppet/type/file/type.rb
puppet-8.0.1-universal-darwin lib/puppet/type/file/type.rb