fs.copy() semantics differ from cp -- no symlink/metadata preservation #40
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#40
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?
fs.copy(src, dst) is implemented as read_file() + write_file() (full content read into memory, rewritten as a new regular file). This differs from shell 'cp' in several ways:
Found while migrating DAW/daw-module-manager (index.lua) from 'os.execute(cp ...)' to fs.copy() for registry-index.json / .minisig files, where this is harmless. Unclear whether other consumers (e.g. daw-modul-storage-* backups, package installs) rely on symlink or metadata preservation via fs.copy() or a similar path.
Needs: audit which callers actually need cp-equivalent semantics, then decide whether fs.copy() should be documented as 'content-only copy, not a cp replacement', or whether a separate fs function (e.g. fs.copy_preserve() shelling out to 'cp -a' via sys) is needed for those cases.