|
|
@ -8,6 +8,14 @@ import ( |
|
|
|
fs "github.com/hack-pad/hackpadfs" |
|
|
|
fs "github.com/hack-pad/hackpadfs" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// OpenFile opens a file on the machine's config directory with the specified flags
|
|
|
|
|
|
|
|
func (m *Machine) OpenFile(name string, flags int, args ...any) (fs.File, error) { |
|
|
|
|
|
|
|
base := m.zone.zones.dir |
|
|
|
|
|
|
|
fullName := m.getFilename(name, args...) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return fs.OpenFile(base, fullName, flags, 0644) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 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 |
|
|
|
base := m.zone.zones.dir |
|
|
|