# module Puppet::Util::Windows::File

### Constants

MoveFileEx
ReplaceFileWithoutBackupW

### Public Class Methods

move_file_ex(source, target, flags = 0) click to toggle source

    # File lib/puppet/util/windows/file.rb, line 18
    def move_file_ex(source, target, flags = 0)
      result = MoveFileEx.call(WideString.new(source.to_s),
                               WideString.new(target.to_s),
                               flags)
      return true unless result == 0
      raise Puppet::Util::Windows::Error.
        new("MoveFileEx(#{source}, #{target}, #{flags.to_s(8)})")
    end

replace_file(target, source) click to toggle source

    # File lib/puppet/util/windows/file.rb, line 8
    def replace_file(target, source)
      result = ReplaceFileWithoutBackupW.call(WideString.new(target.to_s),
                                     WideString.new(source.to_s),
                                     0, 0x1, 0, 0)
      return true unless result == 0
      raise Puppet::Util::Windows::Error.new("ReplaceFile(#{target}, #{source})")
    end