|
|
@ -43,16 +43,9 @@ func (m *Machine) openWriter(name string, flags int, args ...any) (io.WriteClose |
|
|
|
|
|
|
|
|
|
|
|
// RemoveFile deletes a file from the machine's config directory
|
|
|
|
// RemoveFile deletes a file from the machine's config directory
|
|
|
|
func (m *Machine) RemoveFile(name string, args ...any) error { |
|
|
|
func (m *Machine) RemoveFile(name string, args ...any) error { |
|
|
|
base := m.zone.zones.dir |
|
|
|
|
|
|
|
fullName := m.getFilename(name, args...) |
|
|
|
fullName := m.getFilename(name, args...) |
|
|
|
err := fs.Remove(base, fullName) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch { |
|
|
|
return m.zone.zones.RemoveFile(fullName) |
|
|
|
case os.IsNotExist(err): |
|
|
|
|
|
|
|
return nil |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return err |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ReadFile reads a file from the machine's config directory
|
|
|
|
// ReadFile reads a file from the machine's config directory
|
|
|
|