This is the mail archive of the
mailing list for the Cygwin project.
RE: >> /dev/clipboard
- From: Stephan Mueller <Stephan dot Mueller at microsoft dot com>
- To: "Nellis, Kenneth" <Kenneth dot Nellis at acs-inc dot com>, "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Fri, 13 Apr 2012 15:25:37 +0000
- Subject: RE: >> /dev/clipboard
- Deferred-delivery: Fri, 13 Apr 2012 15:25:00 +0000
- References: <2BF01EB27B56CC478AD6E5A0A28931F2043AE34F@A1DAL1SWPES19MB.ams.acs-inc.net>
On Friday, April 13, 2012 7:25 AM, Kenneth Nellis wrote:
" Regarding the following...
" $ echo abc > /dev/clipboard
" $ echo def >> /dev/clipboard
" $ cat /dev/clipboard
"...just curious if the ">>" operator could/should work
" as with a regular file.
The Windows clipboard API isn't "file I/O style", and there's no
function in it to augment existing clipboard content, so it's
perhaps not surprising that it doesn't.
In theory, the code that provide /dev/clipboard could emulate
appending by reading the current content, then writing a full
replacement consisting of the current content plus whatever echo
wrote (in your example), if that code can know whether the file
handle was opened for append. But even if so, you can imagine
it becoming quite inefficient (recopying early data many times)
if someone wrote many short snippets in succession (e.g. many
echo statements like your second one).
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple