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: Writing to /dev/clipboard from multiple processes in Bash gives inconsistent behaviour


> From: Adam Dinwoodie
> On Fri, Feb 13, 2015 at 10:15:30AM -0500, cyg Simple wrote:
> > > From: Adam Dinwoodie
> > >
> > > In which case, I wonder if it's worth adding something to the
> > > FAQ/BLODA
> > about
> > > this?  I guess not, at least until someone independently encounters
> > > this behaviour so it warrants the "F" as well as the "AQ".
> > >
> >
> > I find it strange that someone would be using /dev/clipboard for a
> > temporary buffer of data for a batch process anyway.  Too many
> > opportunities for that data to be corrupted by other actions of the
> > user.  So in other words, just don't do that; it isn't portable and it
> > is prone to error.  The proper use would be for a user to store
> > content in /dev/clipboard that the user would then use immediately to
> > paste elsewhere.  It should never be used for programmatic operation
> > where the operation is dependent on the result later; it wasn't designed
for
> that.
> 
> I'm not sure what gave you the impression anyone was trying to use the
> clipboard as a buffer for a batch process.  I can't see anyone using batch
at all,
> for that matter.  (Or do you mean "shell" instead of "batch"?  The two are
> different things.)
> 

A shell command line can batch commands; a batched process doesn't require a
file.

> My original use case (as mentioned in my original email) was a `find`
command
> that `-exec`'d multiple times to produce output.  That went to the
clipboard, for
> me to paste into a Windows application.
> 

I would put the output to a /tmp/deleted.lst file and when I'm ready to
paste it into the mail I would cat /tmp/deleted.lst > /dev/clipboard.

> The shell code I posted was a simple test case to show the problem, not
actually
> what I'm trying to achieve.  Posting simplified example code that
demonstrates
> a problem is a common way to get help because it means others only need to
> understand the simple example, not the full problem:
> https://cygwin.com/acronyms/#STC

By the design and purpose of the Windows Clipboard your use of
/dev/clipboard is flawed.  You need to change your methods in order to fix
the issue.

--
cyg Simple


--
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]