Sha256: ee0ec5d824db212dde7d25654d148a6272e89f3f9b27544e2850ecd5aae95f95

Contents?: true

Size: 491 Bytes

Versions: 8

Compression:

Stored size: 491 Bytes

Contents

# frozen_string_literal: true

module Puppet
  Puppet::Type.type(:file).newproperty(:mtime) do
    desc "A read-only state to check the file mtime. On \*nix-like systems, this
      is the time of the most recent change to the content of the file."

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

    validate do |_val|
      fail "mtime is read-only"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
puppet-8.10.0 lib/puppet/type/file/mtime.rb
puppet-8.10.0-x86-mingw32 lib/puppet/type/file/mtime.rb
puppet-8.10.0-x64-mingw32 lib/puppet/type/file/mtime.rb
puppet-8.10.0-universal-darwin lib/puppet/type/file/mtime.rb
puppet-8.9.0 lib/puppet/type/file/mtime.rb
puppet-8.9.0-x86-mingw32 lib/puppet/type/file/mtime.rb
puppet-8.9.0-x64-mingw32 lib/puppet/type/file/mtime.rb
puppet-8.9.0-universal-darwin lib/puppet/type/file/mtime.rb