Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bac2e19046 | |||
| 439e93e424 | |||
| 22111ecc05 | |||
| 8e940e0615 | |||
| b903ea957c | |||
| 9f0792cde6 |
@@ -12,9 +12,10 @@ import (
|
|||||||
|
|
||||||
// OpenFile opens a file on the machine's config directory with the specified flags
|
// 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) {
|
func (m *Machine) OpenFile(name string, flags int, args ...any) (fs.File, error) {
|
||||||
|
base := m.zone.zones.dir
|
||||||
fullName := m.getFilename(name, args...)
|
fullName := m.getFilename(name, args...)
|
||||||
|
|
||||||
return m.zone.zones.OpenFile(fullName, flags)
|
return fs.OpenFile(base, fullName, flags, 0644)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateTruncFile creates or truncates a file on the machine's config directory
|
// CreateTruncFile creates or truncates a file on the machine's config directory
|
||||||
@@ -56,9 +57,10 @@ func (m *Machine) RemoveFile(name string, args ...any) error {
|
|||||||
|
|
||||||
// ReadFile reads a file from the machine's config directory
|
// ReadFile reads a file from the machine's config directory
|
||||||
func (m *Machine) ReadFile(name string, args ...any) ([]byte, error) {
|
func (m *Machine) ReadFile(name string, args ...any) ([]byte, error) {
|
||||||
|
base := m.zone.zones.dir
|
||||||
fullName := m.getFilename(name, args...)
|
fullName := m.getFilename(name, args...)
|
||||||
|
|
||||||
return m.zone.zones.ReadFile(fullName)
|
return fs.ReadFile(base, fullName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// WriteStringFile writes the given content to a file on the machine's config directory
|
// WriteStringFile writes the given content to a file on the machine's config directory
|
||||||
|
|||||||
Reference in New Issue
Block a user