@b0rk @endrift only if there’s a way to capture the use of the file handle and set up what amounts to an open-on-use mechanism. I think someone in another branch of the thread mentioned a hypothetical virtual file handle that would work similarly
Conversation
Notices
-
Embed this notice
ShadSterling (shadsterling@mastodon.social)'s status on Saturday, 24-May-2025 17:01:06 JST
ShadSterling
-
Embed this notice
Ryan Castellucci (they/them) :nonbinary_flag: (ryanc@infosec.exchange)'s status on Saturday, 24-May-2025 17:01:06 JST
Ryan Castellucci (they/them) :nonbinary_flag:
@ShadSterling @b0rk @endrift Definitely possible, open an anonymous pipe for the command running under sudo to feed, then open the output file after. The "sponge" command (part of moreutils) does something like this to allow rewriting files, e.g. sort file | sponge file.
That said, it is much simpler to just open the file and pass the descriptor.
-
Embed this notice
Julia Evans (b0rk@social.jvns.ca)'s status on Saturday, 24-May-2025 17:01:08 JST
Julia Evans
@endrift hmm do you think it would be possible for the shell to open the file *after* the program starts?
-
Embed this notice