RE: [OT] patch.exe on Vista is unusable.
- Original Message - From: "Sisyphus" <[EMAIL PROTECTED]> To: "perl-win32-users" Sent: Thursday, September 25, 2008 1:41 PM Subject: [OT] patch.exe on Vista is unusable. > Does anyone have a working patch.exe on Vista ? There's actually nothing wrong with the patch.exe files. The problem is that Vista won't let me run any executable whose name =~ m/patch/i without first getting my Administrator password. Vista doesn't care what the file actually does - it just decides that any executable whose name =~ m/patch/i needs admin privileges to run, and that it can't be run from the command line. (This of course means that I can rename patch.exe to, say, othername.exe, and I can then run it fine - but I have to run it as 'othername', not 'patch'.) Despite the fact that this is a great and wondrous innovation on the part of Microsoft (I bet Linux wish they'd thought of it first), I would like to remove this behaviour. Anyone know how to do that ? Cheers, Rob ## You should be able to run it from the command line once you have a command window up that has already passed the password test. i.e. Right click on the command icon (mine is in the start menu) and choose "Run as Administrator". I'm not sure if this is what you are looking for? Jack ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: [OT] patch.exe on Vista is unusable.
- Original Message - From: "Sisyphus" <[EMAIL PROTECTED]> To: "perl-win32-users" Sent: Thursday, September 25, 2008 1:41 PM Subject: [OT] patch.exe on Vista is unusable. . . > Does anyone have a working patch.exe on Vista ? There's actually nothing wrong with the patch.exe files. The problem is that Vista won't let me run any executable whose name =~ m/patch/i without first getting my Administrator password. Vista doesn't care what the file actually does - it just decides that any executable whose name =~ m/patch/i needs admin privileges to run, and that it can't be run from the command line. (This of course means that I can rename patch.exe to, say, othername.exe, and I can then run it fine - but I have to run it as 'othername', not 'patch'.) Despite the fact that this is a great and wondrous innovation on the part of Microsoft (I bet Linux wish they'd thought of it first), I would like to remove this behaviour. Anyone know how to do that ? Cheers, Rob Cheers, Rob ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: NET SSH2 ppm for 5.10
- Original Message - From: "Michael Ellery" <[EMAIL PROTECTED]> To: "'perl-win32-users'" Sent: Thursday, September 25, 2008 5:24 AM Subject: NET SSH2 ppm for 5.10 > does anyone know of a source for a NET::SSH2 ppm for 5.10? I managed to > get this from uwinnipeg for 5.8, but ppm is telling me it can't find it > in the 5.10 repository (now that I've upgraded). > This has been a troublesome beast to build on Win32 for perl-5.10.0. But, after some minor patching ( http://rt.cpan.org/Public/Bug/Display.html?id=36614 ) I managed to build it on ActivePerl 1004 (perl -5.10.0). I'll send it over to Randy Kobes, and it will probably appear on the uwinnipeg 5.10 rep in the next few days (depending upon how busy Randy is with other stuff). In the meantime, Michael, let me know if you would like me to email the ppm over to you, off list. (It's a bit less than 700kb.) It was a very strange thing to build. On many of my perl builds I get a fatal error of the type: - C:\_32\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: C:\_32\mingw\lib\libkernel32.a(duces00221.o): illegal symbol index 1818586738 in relocs collect2: ld returned 1 exit status dmake: Error code 129, while making 'blib\arch\auto\Net\SSH2\SSH2.dll' - The name of the object file quoted in the message can change from one perl build to the next - but the error is otherwise identical. I have no idea what it means. One would suspect that it's the compiler (or libkernel32.a) that's at fault, but the very same compiler builds the very same source just fine on ActivePerl 1004. Beats me !!! Cheers, Rob ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
[OT] patch.exe on Vista is unusable.
Hi, Well ... it's some perl source that I'm wanting to be able to patch. (But,yeah ... I know ... that doesn't count :-) Does anyone have a working patch.exe on Vista ? At every attempt I make to run 'patch' from the cmd.exe command line I'm prompted for admin password and, having provided that, the bloody thing then gets executed (ie runs and exits in a flash) instead of being run from the command line like I want. This happens for: 1) The patch.exe that's part of MSYS. (If I try to run that particular patch.exe from the MSYS shell I just get a flat "permission denied".); 2) GNU patch-2.5.9-7; 3) The patch.exe that I just copied across from my Windows 2000 machine. (As soon as I stuck it on the Vista box I could tell from its icon that the same problem would arise.) Does anyone here happen to know what one needs to do in order to have a useable patch.exe on Vista ? Cheers, Rob ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
NET SSH2 ppm for 5.10
does anyone know of a source for a NET::SSH2 ppm for 5.10? I managed to get this from uwinnipeg for 5.8, but ppm is telling me it can't find it in the 5.10 repository (now that I've upgraded). Thanks, Mike Ellery ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: info on Perl IDE and debugger in WindowsXP
Thanks everybody. I opted for vim and plain debugger in my XP. Works great for me;) Regards & Thanks Prabir Senapati mailto: [EMAIL PROTECTED] --- On Tue, 9/23/08, Mary <[EMAIL PROTECTED]> wrote: > From: Mary <[EMAIL PROTECTED]> > Subject: Re: info on Perl IDE and debugger in WindowsXP > To: "Brian Raven" <[EMAIL PROTECTED]> > Cc: "perl-win32-users@listserv.activestate.com" > > Date: Tuesday, September 23, 2008, 11:18 PM > Brian Raven wrote: > > Angelos Karageorgiou <> wrote: > > > >> Brian Raven wrote: > >> > >>> Personally I just use an editor that I like > (xemacs), and the > >>> command line debugger. > >>> > >>> HTH > >>> > >>> > >> > >> Dunno about you , but I have found the syntax > highlighting abilities > >> of vim wonderful, it even has a windows version ( > gvim ) > >> > > > > There's no accounting for taste. Oh well, each to > their own :-) > > > > > >> As for debugging , any suggestions for threads > debugging are welcome. > >> > > > > The good old print statement. Likely to be less > intrusive in the face of > > timing related issues than an interactive debugger. > > > I use Perl Express. It makes mistakes in colour coding > regexes but > appart from that I found it OK, > after setting the colour code to my liking. > > Mary > > > > > Vinsamlega athugið að upplýsingar í tölvupósti > þessum og viðhengi eru eingöngu ætlaðar þeim sem > póstinum er beint til og gætu innihaldið upplýsingar sem > eru trúnaðarmál. Sjá nánar: http://www.ru.is/trunadur > > Please note that this e-mail and attachments are intended > for the named addresses only and may contain information > that is confidential and privileged. Further information: > http://www.ru.is/trunadur > ___ > Perl-Win32-Users mailing list > Perl-Win32-Users@listserv.ActiveState.com > To unsubscribe: > http://listserv.ActiveState.com/mailman/mysubs ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Beginner Problems working with spaced filenames and directories on win
Welcome to the world of software development! "It worked fine for years on XYZ.." is something I've heard so often with software that contains hidden bugs that were never found, often because of poor initial design. :-( "perl -w" and "use warnings;" are your friends! Here was my first run, with the code just copy/pasted from your mail message: D:\test>perl-test 1 file(s) copied. 1 file(s) copied. 1 file(s) copied. 1 file(s) copied. 1 file(s) copied. 1 file(s) copied. 1 file(s) copied. syntax error at test-script.bat line 24, near ";," Execution of test-script.bat aborted due to compilation errors. D:\test> The problem appears to be that you have a spurious comma: my $DIR;, if ( -d $top ) { ... } Perl sees this as ( (/*NULL EXPRESSION*/) , (/*IF STATEMENT*/) ); which of course, evaluates the left and right parts of the comma operator, and uses the left- side value as the value of the entire expression.. So it evaluates to a null expression. And Perl is quite happy to do nothing! Here's the fixed scripts (note that I also did some other cleanup, but it's still far from what I'd call a "production" script!).. It works just fine now, as show further below: FILE perl-test.bat: @echo off rem rem Make the directories rem if not exist "some dir with spaces" ( mkdir "some dir with spaces" ) if not exist "some dir with spaces\some subdir with spaces" ( mkdir "some dir with spaces\some subdir with spaces" ) if not exist "some dir with spaces\some subdir with spaces\even deeper" ( mkdir "some dir with spaces\some subdir with spaces\even deeper" ) if not exist "some other dir with spaces" ( mkdir "some other dir with spaces" ) if not exist "some other dir with spaces\monotonous, isn't this" ( mkdir "some other dir with spaces\monotonous, isn't this" ) if not exist "nospaces" ( mkdir "nospaces" ) if not exist "nospaces\done!" ( mkdir "nospaces\done!" ) rem rem Make the files rem if not exist "some filename with spaces.txt" ( copy NUL "some filename with spaces.txt" ) if not exist "some dir with spaces\some subdir with spaces\another file.txt" ( copy NUL "some dir with spaces\some subdir with spaces\another file.txt" ) if not exist "some dir with spaces\some subdir with spaces\even deeper\whee.txt" ( copy NUL "some dir with spaces\some subdir with spaces\even deeper\whee.txt" ) if not exist "some other dir with spaces\more spaces %%and [EMAIL PROTECTED] $chars.txt" ( copy NUL "some other dir with spaces\more spaces %%and [EMAIL PROTECTED] $chars.txt" ) if not exist "some other dir with spaces\monotonous, isn't this\woot.txt" ( copy NUL "some other dir with spaces\monotonous, isn't this\woot.txt" ) if not exist "nospaces\foo.txt" ( copy NUL "nospaces\foo.txt" ) if not exist "nospaces\done!\bar.txt" ( copy NUL "nospaces\done!\bar.txt" ) rem rem Test the script rem call test-script.bat FILE test-script.bat: @rem = '--*-Perl-*-- @echo off if "%OS%" == "Windows_NT" goto WinNT set ORIGPATH9X=%PATH% set PATH=%PATH%;D:\Devel\Perl\Perl5\bin perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 goto endofperl :WinNT setlocal set PATH=%PATH%;D:\Devel\Perl\Perl5\bin perl -x -S %0 %* if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endoffile if %errorlevel% == 9009 echo You do not have Perl in your PATH. if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul goto endofperlNT @rem '; #! /usr/bin/perl -w #line 19 use strict; use warnings; use Data::Dump qw( pp ); sub dir_walk { my ($top, $filefunc, $dirfunc) = @_; my $DIR; if ( -d $top ) { my $file; unless (opendir $DIR, $top) { warn "Couldn't open directory $top: $!; skipping.\n"; return; } my @results; while ($file = readdir $DIR) { next if $file eq '.' || $file eq '..'; push @results, dir_walk("$top/$file", $filefunc, $dirfunc); } return $dirfunc->($top, @results); } else { return $filefunc->($top); } } sub file_func { print "file_func:\t" . pp(@_) . "\n"; } sub dir_func { print "dir_func:\t" . pp(@_) . "\n"; } sub main { dir_walk("d:/test", \&file_func, \&dir_func); } main(); __END__ :endofperlNT endlocal goto e
RE: Beginner Problems working with spaced filenames and directories on win
On Wed, 24 Sep 2008, Dennis Daupert wrote: > > I ran across this bit in one of Randall Schwartz's articles. He talks > about at least one of those File::Find limitations (which may have > been fixed by now, I haven't looked lately.) You may also want to take a look at File::Next: http://search.cpan.org/~petdance/File-Next-1.02/Next.pm (It is already installed if you are running one of the latest ActivePerl releases). Cheers, -Jan ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Beginner Problems working with spaced filenames and directories on win
Kenneth Ölwing <[EMAIL PROTECTED]> wrote: > Hmm, sorry if I steal your thunder :-), but have you looked at File::Find? Hi Ken1, Yes, indeed, I have used File::Find in the past, but ran into some limitations. That's why I was quite excited to hear MJD give a talk on Higher Order Perl at. the NA YAPC a couple years back. I began experimenting with his simple but powerful recursive subroutine code, and now have quite a bit of scripts and apps (on Unix and Linux) that do a number of tricks. I ran across this bit in one of Randall Schwartz's articles. He talks about at least one of those File::Find limitations (which may have been fixed by now, I haven't looked lately.) Randall Schwartz -- http://www.stonehenge.com/merlyn/LinuxMag/col30.html: The traditional File::Find module included with Perl is nice. I use it frequently. However, it's got this interesting feature, or shall we call it, ``limitation'': it wants to be in control until it has found everything of interest. Now that's perfectly fine for most applications, but occasionally, I've wanted to turn a hierarchical search ``inside out''. That is, I'd set up the search, including the start directories and the ``wanted'' criteria, and then call some function repeatedly to get the ``next'' item of interest. This is similar to how I can call the find program externally: open FIND, "find /home -atime +60 -print|"; while () { chomp; printf "%s aged %d days using %d blocks\n", $_, -A $_, -s $_ / 1024; } Recently, I saw Mark-Jason Dominus, Perl hacker extraordinaire, give a talk on using streams and iterators, and he pulled out an example that was very close to what I wanted. He was showing off a subroutine that acted as a factory, generating subroutines that when repeatedly invoked, provided the ``next'' file to be found in sequence. (It's one of his examples from his forthcoming book, some of which may already be found at http://perl.plover.com/book/.) He then went on to show how to put this inside a filter to throw away the files that did not meet the necessary criteria. best, /dennis Dennis Daupert, PhD Senior Systems Development Professional -- CSC Account CSC GOS | o: 1.317.298.9499 | [EMAIL PROTECTED] | www.csc.com This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Beginner Problems working with spaced filenames and directories on win
Hmm, sorry if I steal your thunder :-), but have you looked at File::Find? And the ton of extras for variations, like File::Find::Object, ::Wanted, ::Closures, ::Rule, ::Parallel, ::Node etc etc etc...I would be surprised if you didn't find (no pun intended ;-) something useful in that bunch. ken1 ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Beginner Problems working with spaced filenames and directories on win
[EMAIL PROTECTED] (Chris Wagner) wrote: > I would put some print statements in there to verify that the > variables contain what u think they contain. Hi Chris, thanks for your reply. Yes, I had lots of prints in my original code; I snipped those out to make my post briefer. > Another thing I noticed. Normally u want "opendir DIR, $top", not $DIR. No, it needs to have $DIR. That's what makes the recursive subroutine re-entrant. Each time the code re-enters the subroutine, it makes a new copy of $DIR, which holds the filehandle for the next node being inspected as it traverses the directory tree. > A best practice is to always have an else{} block after any if{} > blocks to catch and debug errors. I did have this in my original. Sysyphus asked for more complete code, which I posted. That includes debug prints and if/else blocks. The good thing is, the test script actually runs! best, /dennis Dennis Daupert, PhD Senior Systems Development Professional -- CSC Account CSC GOS | o: 1.317.298.9499 | [EMAIL PROTECTED] | www.csc.com This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Re: Beginner Problems working with spaced filenames and directories on win
Dennis wrote: >> The script has a problem when it hits a directory or filename containing >> spaces. "Sisyphus" <[EMAIL PROTECTED]> said: > Probably best if you could provide a small standalone > script (or one liner) that we can all run, and that > demonstrates the problem. Once I've created a test script based on my code, the test script runs just fine! My problem must be at some other place. I'll be tracking that down. I'll paste a full copy of the test script I based on the original code. I'll post it here, since it has been so damned useful, people might want to use it. The recursive subroutine calls two callbacks, and you can do all sorts of useful things in whatever callbacks you point to. I have a number of scripts based on dir_walk (Thank you, MJD!) #! -perl- use strict; use warnings; system('cls'); Set variables my $toplevel = 'C:\PROJECTS\ACTIVE\R1.4\r1.4 Hotfixes'; my %the = ('debug' => 1); my $the = \%the; Call main subroutine. print "Executing $0)\n"; &dir_walk ( "$toplevel", \&print_file, \&print_dir ); exit; =head2 print_file First callback =cut sub print_file { print "File: ", $_[0] , "\n"; } =head2 print_file Second callback =cut sub print_dir { print "Directory: ", $_[0] , "\n"; return; } =head2 dir_walk This is the heart of the application. The routine walks a directory tree located at some path, supplied in argument $top $filefunc and $dirfunc are two callbacks, supplied as subroutine references =cut sub dir_walk { my ($top, $filefunc, $dirfunc) = @_; my $DIR;, print "In sub dir_walk\n" if $the->{debug} == 1; print "top: $top\n" if $the->{debug} == 1; if ( -d $top ) { print "toplevel is a DIR; opendir it\n" if $the->{debug} == 1; my $file; unless (opendir $DIR, $top) { warn "Couldn't open directory $top: $!; skipping.\n";} return; } my @results; FILE: while ($file = readdir $DIR) { next FILE if $file eq '.' || $file eq '..'; print "File: $file\n" if $the->{debug} == 1; push @results, dir_walk("$top/$file", $filefunc, $dirfunc);; } return $dirfunc->($top, @results); } else { print "flag -d did not detect a dir: $top \n" if $the->{debug} == 1; return $filefunc->($top); } } best, /dennis Dennis Daupert, PhD Senior Systems Development Professional -- CSC Account CSC GOS | o: 1.317.298.9499 | [EMAIL PROTECTED] | www.csc.com This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by e-mail of the mistake in delivery. NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose. ___ Perl-Win32-Users mailing list Perl-Win32-Users@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs