feat(fs): add fs.tmpdir() and fs.tmpfile() for portable temp path handling #32
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#32
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?
Problem
There is no standardized way to create temporary files or directories
in the DAW ecosystem. Code that needs temp paths currently hardcodes
/tmp/directly, which violates the no-hardcoded-tmp-prefix rule andis not portable across OS installations.
Examples of current workarounds
Goal
Add
fs.tmpdir()and/orfs.tmpfile(prefix)todaw.common.fsreturning a OS-appropriate temp path, abstracting away
/tmp/hardcoding.Acceptance Criteria
fs.tmpdir()returns a writable temp directory path for the current OSfs.tmpfile(prefix)returns a unique temp file path with daw_ prefix/tmp/migrated to use these functionsNotes
Current workaround: suppress no-hardcoded-tmp-prefix with reference to
this issue. Migration of existing code (crypto.lua, base64.lua,
article.lua etc.) as separate follow-up once fs functions are available.
Related: DAW/daw-lua-common (fs.lua)
Implemented via
mktemp -d/mktempthroughsys:run()-- samepattern as
fs.abspath(). No prefix parameter, no hardcoded pathconstruction; the OS handles uniqueness and temp location.
55 tests passing on Lua 5.1 and 5.4.
Note: acceptance criteria mentioned a
daw_prefix -- dropped infavour of plain
mktempoutput (e.g./tmp/tmp.Nw3W6dOoeO).Migration of existing hardcoded
/tmp/usage (crypto.lua, base64.lua,article.lua) remains as separate follow-up.