Run with internal flag when saving with sudo on Windows #3578
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An internal flag is used, because there is no program available by default on Windows that can be used in place of the
dd
command.I was running
micro -encoding shift_jis C:\test.txt
then saving withファイル内容
as content when testing. There should be no text corruption when running the command again to check how file is written.The methods below were considered:
ShellExecute
: data cannot be written to the standard input of the processAll programs below except
runas
worked when used assucmd
:runas
sudo
name can be enabled using installerCloses #3541