Add fs.remove_dir_recursive() for temp directory cleanup #36
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-lua-common#36
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
daw.common.fs currently has no equivalent to 'rm -rf' for recursive directory removal. fs.remove() only handles single files / empty directories via os.remove().
Use case: daw-module-manager/sig.lua creates a temp dir via fs.tmpdir() (mktemp -d) to hold a pubkey during signature verification, and needs to clean it up afterwards -- currently falls back to sys:run_rc('rm -rf ' .. dir) directly in program code, which daw-code-standard.md flags as a violation (external calls belong in common/adapters).
Needs: fs.remove_dir_recursive(path) -> true, nil | nil, err. Should probably build on fs.list_files/fs.list_dirs recursion + fs.remove, or shell out via daw.common.sys internally (fs is allowed to use sys, program code is not).
Related: DAW/daw-module-manager (sig.lua TMPDIR cleanup).
Implemented in fs/dir.lua, shells out via daw.common.sys (rm -rf). Wired into fs/init.lua and dev-module-map.lua. Tested in test_fs.lua including the guardrails against path == "/" or "".
Implemented in fs/dir.lua, shells out via daw.common.sys (rm -rf). Wired into fs/init.lua and dev-module-map.lua. Tested in test_fs.lua including the guardrails against path == "/" or "".
Implemented in fs/dir.lua, shells out via daw.common.sys (rm -rf). Wired into fs/init.lua and dev-module-map.lua. Tested in test_fs.lua including the guardrails against path == "/" or "".