pkg/environment: Remove some file-based functions
This commit removes certain file-based functions from 'pkg/environment', continuing the migration to entirely remove the package.
This commit is contained in:
parent
39207a1cb5
commit
45540ab253
20 changed files with 52 additions and 120 deletions
|
|
@ -2,6 +2,7 @@ package fsx
|
|||
|
||||
import (
|
||||
"io/fs"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/FAU-CDI/wisski-distillery/pkg/environment"
|
||||
|
|
@ -16,7 +17,7 @@ func Touch(env environment.Environment, path string, perm fs.FileMode) error {
|
|||
if perm == 0 {
|
||||
perm = environment.DefaultFilePerm
|
||||
}
|
||||
_, err := env.Stat(path)
|
||||
_, err := os.Stat(path)
|
||||
switch {
|
||||
case environment.IsNotExist(err):
|
||||
f, err := env.Create(path, perm)
|
||||
|
|
@ -29,6 +30,6 @@ func Touch(env environment.Environment, path string, perm fs.FileMode) error {
|
|||
return err
|
||||
default:
|
||||
now := time.Now().Local()
|
||||
return env.Chtimes(path, now, now)
|
||||
return os.Chtimes(path, now, now)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue