Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16817

Re: How do we intercept file saving or output to stdout directly

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: How do we intercept file saving or output to stdout directly
Date 2020-08-26 08:13 -0400
Message-ID <mailman.1318.1598444063.2469.bug-bash@gnu.org> (permalink)
References <1598249852364-0.post@n7.nabble.com> <87a6yinjhl.fsf@hobgoblin.ariadne.com> <20200826121352.GN931@eeg.ccf.org>

Show all headers | View raw


On Wed, Aug 26, 2020 at 12:01:26AM -0400, Dale R. Worley wrote:
> open("/dev/stdout", O_WRONLY|O_CREAT|O_EXCL, 0666) = -1 EEXIST (File exists)
> write(2, "Error:            ", 18Error:            )      = 18
> write(2, "Cannot open \"/dev/stdout\" to wri"..., 56Cannot open "/dev/stdout" to write keyboard description
> ) = 56
> 
> The open() is done with the O_EXCL flag.  Reading the manual page
> open(2), I see that O_EXCL requires that the open() call creates the
> file.
> 
> It's not clear why xkbcomp has this behavior, but it seems likely that
> this is done for a specific reason.  So you will have to ask whoever
> maintains it.

The obvious guess is that it's to "prevent you from accidentally
overwriting a file".

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: How do we intercept file saving or output to stdout directly Greg Wooledge <wooledg@eeg.ccf.org> - 2020-08-26 08:13 -0400

csiph-web