Re: 1.7.0: Getting a Windows app to run synchronously to a script from which it is invoked

2009-03-24 Thread Corinna Vinschen
On Mar 23 20:01, Lee D. Rothstein wrote:
 Corinna Vinschen wrote:
 On Mar 22 20:26, Lee D.Rothstein wrote:
   snip
   

 First of all, the explorer command does not stop input from the
 terminal.  When I invoke the above script, I get an explorer window
 *and* I can type into the calling shell again because explorer is
 running detached.  Experiments with notepad show that notepad is running
 synchronously, so in that case the shell is waiting for notepad to exit.
 I get this behaviour consistently on 1.5 and 1.7.
   
 This is my oversight. I used the wrong example, but even for the right  
 example, I believe I
 misdiagnosed the problem. The correct, verified diagnosis follows (I hope).

 After some more research I find the actual problem with Cygwin 1.7, is that
 if you try to open open a file with a Windows app through its softlink,  
 (in the
 directory of both the file and its softlink) the Windows app opens the
 softlink, not the file to which it is linked. This only happens with  
 Windows apps, and
 the problem does not happen with Cygwin 1.5. (I just tested it on both  
 versions.)

Hmm.  What kind of softlink are you talking about?  Is that a
Windows shortcut created by Windows?  Or is that a Cygwin symlink?
If the latter, did you create the symlink way back when, or did you
create the symlink under Cygwin 1.7?  If the latter, the symlink
is probably not a Windows shortcut anymore, rather the other Cygwin
style of symlink which is a file with the SYSTEM DOS attribute set.
In this case it's no wonder Windows opens the file, rather than to
follow the shortcut to its target.  I made the change because the
SYSTEM type shortcuts are faster.  If you want to have the Windows
shortcut style symlinks back because you use them to interoperate
with native Windows tools, you have to set the CYGWIN=winsymlinks
option now.


Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

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



RE: 1.7.0: Getting a Windows app to run synchronously to a script from which it is invoked

2009-03-24 Thread Thrall, Bryan
Corinna Vinschen wrote on Tuesday, March 24, 2009 5:17 AM:
 Hmm.  What kind of softlink are you talking about?  Is that a
 Windows shortcut created by Windows?  Or is that a Cygwin symlink?
 If the latter, did you create the symlink way back when, or did you
 create the symlink under Cygwin 1.7?  If the latter, the symlink
 is probably not a Windows shortcut anymore, rather the other Cygwin
 style of symlink which is a file with the SYSTEM DOS attribute set.
 In this case it's no wonder Windows opens the file, rather than to
 follow the shortcut to its target.  I made the change because the
 SYSTEM type shortcuts are faster.  If you want to have the Windows
 shortcut style symlinks back because you use them to interoperate
 with native Windows tools, you have to set the CYGWIN=winsymlinks
 option now.

This is a change from 1.5, right? The 1.5 user guide says winsimlinks
is the default, and the 1.7 user guide says nowinsimlinks is.

It seems like this change was missed in
http://cygwin.com/1.7/cygwin-ug-net/ov-new1.7.html

-- 
Bryan Thrall
FlightSafety International
bryan.thr...@flightsafety.com

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



Re: 1.7.0: Getting a Windows app to run synchronously to a script from which it is invoked

2009-03-24 Thread Corinna Vinschen
On Mar 24 08:37, Thrall, Bryan wrote:
 Corinna Vinschen wrote on Tuesday, March 24, 2009 5:17 AM:
  Hmm.  What kind of softlink are you talking about?  Is that a
  Windows shortcut created by Windows?  Or is that a Cygwin symlink?
  If the latter, did you create the symlink way back when, or did you
  create the symlink under Cygwin 1.7?  If the latter, the symlink
  is probably not a Windows shortcut anymore, rather the other Cygwin
  style of symlink which is a file with the SYSTEM DOS attribute set.
  In this case it's no wonder Windows opens the file, rather than to
  follow the shortcut to its target.  I made the change because the
  SYSTEM type shortcuts are faster.  If you want to have the Windows
  shortcut style symlinks back because you use them to interoperate
  with native Windows tools, you have to set the CYGWIN=winsymlinks
  option now.
 
 This is a change from 1.5, right? The 1.5 user guide says winsimlinks
 is the default, and the 1.7 user guide says nowinsimlinks is.
 
 It seems like this change was missed in
 http://cygwin.com/1.7/cygwin-ug-net/ov-new1.7.html

Right, it was only documented inside the User's Guide, for instance in
http://cygwin.com/1.7/cygwin-ug-net/using-cygwinenv.html

I'll fix that.


Thanks for the reminder,
Corinna

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

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



Re: 1.7.0: Getting a Windows app to run synchronously to a script from which it is invoked

2009-03-23 Thread Corinna Vinschen
On Mar 22 20:26, Lee D.Rothstein wrote:
 This is in all probability, not a bug. I suspect it falls into CGF's
 category of works but isn't (wasn't) guaranteed.

 All of my scripts (developed under Cygwin 1.5 or earlier) that involve
 a Windows native app use:

  winapp $(cygpath -w $something)

 have stopped working properly since I installed Cygwin 1.7.

 Here's the script I use, FOR EXAMPLE, for invoking Windows Explorer to the
 current directory or a specified Cygwin directory path, AND that stops
 further use of the invoked from terminal window, until this Explorer
 window terminates:

  #!/usr/bin/bash

  if [[ -n $1 ]] ; then cd $1 ; fi
  explorer $(cygpath -w .)

I'm somewhat puzzled.

First of all, the explorer command does not stop input from the
terminal.  When I invoke the above script, I get an explorer window
*and* I can type into the calling shell again because explorer is
running detached.  Experiments with notepad show that notepad is running
synchronously, so in that case the shell is waiting for notepad to exit.
I get this behaviour consistently on 1.5 and 1.7.

Second, in my case the explorer window is opened in the correct
directory.  Again, this works fine in 1.5 and 1.7.

Is it possible that this is OS dependent?  I've tested on XP SP3.

 Is there no straight-forward way to invoke a windows app from a script
 synchronously with Cygwin 1.7?

I don't think so, at least not really and I'm not sure that's
Cygwin's fault or something.  Sometimes when you think you start
a Windows application you actually just call a wrapper which then
starts another application using COM or other methods.  In case
of explorer, there's no guarantee that you really start the process
which then opens the window.  For instance, there's a folder option
in Explorer called Launch folder windows in a separate process.
So, given that one instance of explorer is running the GUI anyway,
which process will run the newly opened window?


Corinna


P.S.: If that would be my script, I'd use cygpath -wa, to get always
an absolute Windows path, btw.  This removes the trailing backslash
you always get when calling `cygpath -w .'.


-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

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



Re: 1.7.0: Getting a Windows app to run synchronously to a script from which it is invoked

2009-03-23 Thread Sylvain RICHARD

Lee D.Rothstein wrote:

This is in all probability, not a bug. I suspect it falls into CGF's
category of works but isn't (wasn't) guaranteed.

All of my scripts (developed under Cygwin 1.5 or earlier) that involve
a Windows native app use:

 winapp $(cygpath -w $something)

have stopped working properly since I installed Cygwin 1.7.

Here's the script I use, FOR EXAMPLE, for invoking Windows Explorer to 
the

current directory or a specified Cygwin directory path, AND that stops
further use of the invoked from terminal window, until this Explorer
window terminates:

 #!/usr/bin/bash

 if [[ -n $1 ]] ; then cd $1 ; fi
 explorer $(cygpath -w .)

Explorer opens okay, but always to the Computer folder, rather than the
current working or specified directory. (Yes, I know that there is a
special option for Explorer in 'cygstart'. Please read on.)
In the special case of the shell, there's also MS's wisdom to consider. 
To wit:

http://support.microsoft.com/kb/152457


I found that I can make the above work by replacing the invocation using
'cygpath' with a 'cygstart' initiated invocation without 'cygpath', at
all. The problem with this latter fix, however, is that 'cygstart' 
invokes

the Windows app asynchronously to the script in which it is contained.
Sometimes I want the script continuance to be tethered to the Windows
app, and the only way to do this (that I can see), is to put an otherwise
superfluous 'read' statement right after the Windows app invocation. 
Ugly,

and not as obvious, to the user, as the old method.

Is there no straight-forward way to invoke a windows app from a script
synchronously with Cygwin 1.7?


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





--
Sylvain RICHARD


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



Re: 1.7.0: Getting a Windows app to run synchronously to a script from which it is invoked

2009-03-23 Thread Lee D. Rothstein

Corinna Vinschen wrote:

On Mar 22 20:26, Lee D.Rothstein wrote:
  
snip
  



First of all, the explorer command does not stop input from the
terminal.  When I invoke the above script, I get an explorer window
*and* I can type into the calling shell again because explorer is
running detached.  Experiments with notepad show that notepad is running
synchronously, so in that case the shell is waiting for notepad to exit.
I get this behaviour consistently on 1.5 and 1.7.
  
This is my oversight. I used the wrong example, but even for the right 
example, I believe I

misdiagnosed the problem. The correct, verified diagnosis follows (I hope).

After some more research I find the actual problem with Cygwin 1.7, is that
if you try to open open a file with a Windows app through its softlink, 
(in the

directory of both the file and its softlink) the Windows app opens the
softlink, not the file to which it is linked. This only happens with 
Windows apps, and
the problem does not happen with Cygwin 1.5. (I just tested it on both 
versions.)


This is what confused me about all the other results I reported.

However, if I use '$(cygpath -wa SOFTLINK)', the windows app opens the 
correct file.
So, in summary, 'cygpath' works!, but Cygwin 1.7 appears to not 
dereference the link

for Windows apps as it did with Cygwin 1.5, unless 'cygpath' is used.

WRT, explorer ever running synchronously, I thought that at one point 
(perhaps pre 1.5,
and pre-XP) that you could get Explorer to run synchronously, but I may 
be mistaken.

That's (at the very least) the age of the mistakenly referenced script.

Corinna


P.S.: If that would be my script, I'd use cygpath -wa, to get always
an absolute Windows path, btw.  This removes the trailing backslash
you always get when calling `cygpath -w .'.

  
Thanks for the advice and sorry to have bothered you with the prior 
misinformation.


BTB, aside from this obscure difference (that seems to have only impacted my
ancient and ill-conceived scripts), I am enjoying Cygwin 1.7. Thank you, 
very much.


Lee

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



1.7.0: Getting a Windows app to run synchronously to a script from which it is invoked

2009-03-22 Thread Lee D.Rothstein

This is in all probability, not a bug. I suspect it falls into CGF's
category of works but isn't (wasn't) guaranteed.

All of my scripts (developed under Cygwin 1.5 or earlier) that involve
a Windows native app use:

 winapp $(cygpath -w $something)

have stopped working properly since I installed Cygwin 1.7.

Here's the script I use, FOR EXAMPLE, for invoking Windows Explorer to the
current directory or a specified Cygwin directory path, AND that stops
further use of the invoked from terminal window, until this Explorer
window terminates:

 #!/usr/bin/bash

 if [[ -n $1 ]] ; then cd $1 ; fi
 explorer $(cygpath -w .)

Explorer opens okay, but always to the Computer folder, rather than the
current working or specified directory. (Yes, I know that there is a
special option for Explorer in 'cygstart'. Please read on.)

I found that I can make the above work by replacing the invocation using
'cygpath' with a 'cygstart' initiated invocation without 'cygpath', at
all. The problem with this latter fix, however, is that 'cygstart' invokes
the Windows app asynchronously to the script in which it is contained.
Sometimes I want the script continuance to be tethered to the Windows
app, and the only way to do this (that I can see), is to put an otherwise
superfluous 'read' statement right after the Windows app invocation. Ugly,
and not as obvious, to the user, as the old method.

Is there no straight-forward way to invoke a windows app from a script
synchronously with Cygwin 1.7?


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



'cygstart' option? was Re: 1.7.0: Getting a Windows app to run synchronously to a script from which it is invoked

2009-03-22 Thread Lee D.Rothstein

I figured out a solution, but it still has limitations.

The solution:

It just requires doing a cd into the path (complete directory path) of the
argument, and cd'ing into that path. If the command operates on a
directory as Explorer does, then you submit '.' as the argument.
If the command requires a file name, you just submit the
'basename' as the argument.

I used to do this years ago (starting with the MKS toolkit, and then
the Thompson toolkit), but stopped once I became conversant
with 'cygpath'. Brain damage is my excuse for forgetting.

However, this will only work with Windows programs that themselves are
synchronous, OTB (out of the box). This won't work, for example,
with OpenOffice (OO) after about version 1.5, or WinWord after version
10, or thereabouts. OO really bummed me out, when they made the change,
invalidating all my blogging scripts. That's when I started using the 'read'
nonsense. Actually, more recently, they both require 'cygstart' or they 
flat out

blow up. However, you don't have to specifiy the command name
at all, just the file name argument. But you still end up with the 
asynch start.


In brief, it would be very nice if there was a cygstart option that did 
not exit

until the command which it starts exits. Is this possible?

Lee

Lee D.Rothstein wrote:

This is in all probability, not a bug. I suspect it falls into CGF's
category of  works but isn't (wasn't) guaranteed.

All of my scripts (developed under Cygwin 1.5 or earlier) that involve
a Windows native app use:

 winapp $(cygpath -w $something)

have stopped working properly since I installed Cygwin 1.7.

Here's the script I use, FOR EXAMPLE, for invoking Windows Explorer to 
the

current directory or a specified Cygwin directory path, AND that stops
further use of the invoked from terminal window, until this Explorer
window terminates:

 #!/usr/bin/bash

 if [[ -n $1 ]] ; then cd $1 ; fi
 explorer $(cygpath -w .)

Explorer opens okay, but always to the Computer folder, rather than the
current working or specified directory. (Yes, I know that there is a
special option for Explorer in 'cygstart'. Please read on.)

I found that I can make the above work by replacing the invocation using
'cygpath' with a 'cygstart' initiated invocation without 'cygpath', at
all. The problem with this latter fix, however, is that 'cygstart' 
invokes

the Windows app asynchronously to the script in which it is contained.
Sometimes I want the script continuance to be tethered to the Windows
app, and the only way to do this (that I can see), is to put an otherwise
superfluous 'read' statement right after the Windows app invocation. 
Ugly,

and not as obvious, to the user, as the old method.

Is there no straight-forward way to invoke a windows app from a script
synchronously with Cygwin 1.7?


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





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