This is the mail archive of the cygwin@cygwin.com 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]

example needed pls: `cygpath -c <HANDLE>'


[posted and mailed]

Hi! The ever-fascinating "cygpath" tool once again beckons to me to plumb 
its depths ...

I am trying to finish a test script that uses ActivePerl to call `cygpath` 
from itself (a system call, by open()-ing a pipe to capture the output of 
the tool ...

  {... stuff ...}
  open(CTH, '-|', "C:/cygwin/bin/cygpath $MS_path_filename")
    or die "Could not open() call to 'cygpath', what is up?";
  $cygstyle_path = <CTH>;
  chomp $cygstyle_path;
  {... stuff ...}

 (troubled?: `perldoc open' or read the Camel 3rd Ed.;
  this is the new {$] >= 5.6.1} 3-argument form of open().)

I tried simple backticks too ;-). The point is that I get every indication 
by rigorously checking the return values of the calls to open(), close() 
and checking Perl built-in vars $! and $?, that the call to cygpath 
*worked*, but when I try to examine the string returned ($cygstyle_path), 
it is always empty!

So anyway, I am chasing all geese of any degree of domestication at this
point. I've tried searching in the several ways and cannot believe
no-one has asked before, but: please someone, provide an example of the
use of the "-c" flag to "cygpath", e.g. 

   cygpath -c <something> -u 'C:\\foo\\bar\fump.rey'

What values should "<something>" have? I do not really understand the 
manual explanation of what this flag is for. Could it help me here?

Any other insights also appreciated.

A couple of answers to anticipated questions from the idle
onlookers ;-) ... :

  * yeah,  am using AS Perl, that's because this is a piece of
    a WSH script.
  * what I'd like to end up with is a way to context|alternate-click
    on any filename in MSWindows Explorer and place the filename as
    *cygwin*, not the OS, will see it, on the clipboard. Anyone
    already had a pass at this wheel?

  Soren A.

-- 
"So, tell me, my little one-eyed one, on what poor, pitiful,
defenseless planet has my MONSTROSITY been unleashed?"
                       - Dr. Jumba, Disney's "Lilo & Stitch"
OpenPGP Key at http://savannah.gnu.org/people/viewgpg.php?user_id=6050


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


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