Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to modify files in-place #191

Open
tennox opened this issue May 16, 2023 · 2 comments
Open

Add option to modify files in-place #191

tennox opened this issue May 16, 2023 · 2 comments
Labels
C-enhancement Category: New feature or request

Comments

@tennox
Copy link

tennox commented May 16, 2023

# in /srv/our-board/
$ sd foo bar test.txt
Error processing .env: Permission denied (os error 13) at path "/srv/our-board/.tmp4oOZn4"

Would love it if:

  1. it would exit with a code > 0
  2. if there was a flag (or the default) to not need a tmp file at all (as I don't have write access to the directory
@CosmicHorrorDev
Copy link
Collaborator

The first part should already be handled by #186

@CosmicHorrorDev
Copy link
Collaborator

Also for the second part I don't think it would be good as the default (although I'd be open to having a flag to configure)

It's writing to a temp file and then renaming things to handle atomic file writing. Writing to the file in-place can lead to issues where an operation was only able to partially complete (the machine may power off before finishing for instance)

@CosmicHorrorDev CosmicHorrorDev changed the title Fails without exit code when user has no write permission on directory Add option to modify files in-place May 17, 2023
@CosmicHorrorDev CosmicHorrorDev added the M-needs triage Meta: Maintainer label me! label May 17, 2023
tennox added a commit to tennox/sd that referenced this issue May 17, 2023
tennox added a commit to tennox/sd that referenced this issue May 17, 2023
tennox added a commit to tennox/sd that referenced this issue May 17, 2023
@CosmicHorrorDev CosmicHorrorDev added C-enhancement Category: New feature or request and removed M-needs triage Meta: Maintainer label me! labels Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants