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]

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


Soren Andersen wrote:

On Sun, Jun 29, 2003 at 12:17:01PM +0200, Gerrit P. Haase wrote:


Hallo Soren,





you also wrote:


I am trying to finish a test script that uses ActivePerl to call `cygpath`
{... 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 ...}


#!/bin/perl

$MS_path_filename = 'H:\bin';
$MS_path_filename = quotemeta($MS_path_filename);
open(CTH, '-|', "H:/bin/cygpath $MS_path_filename")
 or die "Could not open() call to 'cygpath', what is up?";
$cygstyle_path = <CTH>;
chomp $cygstyle_path;

print "$cygstyle_path\n";

# SCRIPT_END



{Gerrit's output}


$ /bin/soren_problem.pl
/bin





What is the problem?



See my original message please! What I was asking for was an explanation of the cygpath flag -c <HANDLE>.

I know the code above works, it ran for me too. First of all you aren't
reproducing the conditions of the test: NOT CygPerl, but Win32Perl (AS
Perl); secondly NOT on the console/terminal commandline but in a WSH
script (the code is executed when the "hooks" built in to WSH which know
how to call AS Perl, do so); and lastly I am not asking for readers to
reproduce the test (because it might be onerous to do so, because
they've never used WSH or don't have AS Perl installed, but if someone
does have a system which meets those criteria I'd be mightily obliged if
they would try).

I am just trying to understand what it might be about "cygpath" that it
cannot output anything under *these* conditions. Or find out whatever
there is to find out.

Thanks Gerrit!
Soren A.


Just goes to show.
I didn't want to get into asp but I created this wsh file
checkpath.wsf
-------------------------------
<Job ID="CheckPath">
<script language=PerlScript>
$MS_path_filename="c:\\bin\\gzip.exe";
$WScript->Echo("$MS_path_filename");
open(CTH, '-|', "D:/cygwin/bin/cygpath $MS_path_filename")
or die $WScript->Echo("Could not open() call to 'cygpath', what is up?");
$cygstyle_path = <CTH>;
chomp $cygstyle_path; $WScript->Echo("A" . "$cygstyle_path" . "B");
</script>
</Job>
------------------------------
pretty much your original post.
I'm finding it only works with AS perl 5.8.0.805.
In 5.6.1.633 the return value is empty but 5.8 works as expected.
I tried this first with cygwin 1.3.21 & 1.3.22 and
before & after upgrading to 5.6 windows script host.
Can't blame cygwin


--
Doug VanLeuven




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