This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: >> /dev/clipboard


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
" def
" $
"
"...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).

stephan($0.02);




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]