Compress-Zlib and IO-Compress conflict

Compress-Zlib and IO-Compress conflict

am 08.07.2009 16:01:50 von Suresh Govindachar

Hello,

ppm reports a conflict between Compress-Zlib and IO-Compress, as
follows:

Installed modules:

c:\home\suresh>ppm list --matching *compress*
+------------------------------------------------------+
| name | version | files | size | area |
+--------------------+---------+-------+--------+------|
| Compress-Raw-Bzip2 | 2.020 | 8 | 97 KB | site |
| Compress-Raw-Bzip2 | 2.019 | 7 | 77 KB | perl |
| Compress-Raw-Zlib | 2.020 | 8 | 208 KB | site |
| Compress-Raw-Zlib | 2.019 | 7 | 142 KB | perl |
| Compress-Zlib | 2.015 | 4 | 41 KB | site |
| IO-Compress | 2.019 | 29 | 490 KB | perl |
+------------------------------------------------------+
(6 packages installed matching '*compress*')

So IO-Compress needs to be upgraded to 2.020.

c:\home\suresh>ppm search IO-Compress
1: IO-Compress
IO Interface to compressed data files/buffers
Version: 2.020
Released: 2009-06-03
Repo: ActiveState Package Repository

2: IO-Compress
IO Interface to compressed data files/buffers
Version: 2.020
Repo: bribes

3: IO-Compress
IO Interface to compressed data files/buffers
Version: 2.019
Repo: trouchelle

c:\home\suresh>ppm install 2
Downloading IO-Compress-2.020...done
Unpacking IO-Compress-2.020...done
Generating HTML for IO-Compress-2.020...done
Updating files in site area...failed
ppm install failed: File conflict for 'C:/opt/perl/html/site/lib/Compress/Zlib.html'.
The package Compress-Zlib has already installed a file
that package IO-Compress wants to install. Uninstall
Compress-Zlib, or use --force to allow files to be
overwritten.


How best to resolve this conflict? (I tried contacting the author
of these modules, but have not heard back from him.)

Thanks,

--Suresh


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Compress-Zlib and IO-Compress conflict

am 08.07.2009 19:33:21 von Jan Dubois

On Wed, 08 Jul 2009, Suresh Govindachar wrote:
>
> ppm reports a conflict between Compress-Zlib and IO-Compress, as
> follows:
>
> Installed modules:
>
> c:\home\suresh>ppm list --matching *compress*
> +------------------------------------------------------+
> | name | version | files | size | area |
> +--------------------+---------+-------+--------+------|
> | Compress-Raw-Bzip2 | 2.020 | 8 | 97 KB | site |
> | Compress-Raw-Bzip2 | 2.019 | 7 | 77 KB | perl |
> | Compress-Raw-Zlib | 2.020 | 8 | 208 KB | site |
> | Compress-Raw-Zlib | 2.019 | 7 | 142 KB | perl |
> | Compress-Zlib | 2.015 | 4 | 41 KB | site |
> | IO-Compress | 2.019 | 29 | 490 KB | perl |
> +------------------------------------------------------+
> (6 packages installed matching '*compress*')

You need to uninstall Compress-Zlib before installing IO-Compress.

Compress-Zlib used to be a separate distribution on CPAN but has been
merged into IO-Compress lately. So I suspect all you need to do is:

ppm remove Compress-Zlib
ppm upgrade IO-Compress

Cheers,
-Jan

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Read file names as per Windows file listing order

am 09.07.2009 09:44:31 von Ramkumar

Hi All,

In windows explorer, files in a folder displaying (name sort) as,
Chapter 1.doc
Chapter 2.doc
Chapter 3.doc
Chapter 4.doc
Chapter 12.doc
Chapter 20.doc
Chapter 21.doc
Chapter 30.doc
Chapter 31.doc
Chapter 40.doc
Chapter 41.doc
Chapter 42.doc

I need the above list/result using Perl. But Perl gives result as below,
Chapter 1.doc
Chapter 12.doc
Chapter 2.doc
Chapter 20.doc
Chapter 21.doc
Chapter 3.doc
Chapter 30.doc
Chapter 31.doc
Chapter 4.doc
Chapter 40.doc
Chapter 41.doc
Chapter 42.doc

I have tried (3 different ways) the below code:

(1) opendir(DIR, $folderpath) || die "Error in opening dir $dirname\n";
while(($filename = readdir(DIR)))
{print("$filename\n");}
closedir(DIR);
(2) @xmlfiles = File::Find::Rule->file()->name('*.doc')->in($folderpath);
(3) system("dir/b >\"$folderpath\\TextFiles.txt\"");

Please suggest if you have any idea to achive my requirement in perl.

Regards,
Ramkumar,


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Read file names as per Windows file listing order

am 09.07.2009 10:29:17 von Angelos Karageorgiou

This is a multi-part message in MIME format.
--------------060606040407050602020904
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Ramkumar wrote:

[deleted]


> (1) opendir(DIR, $folderpath) || die "Error in opening dir $dirname\n";
> while(($filename = readdir(DIR)))
> {print("$filename\n");}
> closedir(DIR);
> (2) @xmlfiles = File::Find::Rule->file()->name('*.doc')->in($folderpath);
> (3) system("dir/b >\"$folderpath\\TextFiles.txt\"");
>
> Please suggest if you have any idea to achive my requirement in perl.

perldoc find2perl

and then edit the wanted function that it emits!

Good luck

--------------060606040407050602020904
Content-Type: text/x-vcard; charset=utf-8;
name="angelos.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="angelos.vcf"

begin:vcard
fn:Angelos Karageorgiou
n:Karageorgiou;Angelos
org:Vivodi Telecommunications S.A.
email;internet:angelos@unix.gr
title:Technology Manager
tel;work:+30 211 7503 893
tel;fax:+30 211 7503 701
tel;cell:+30 6949120773
note;quoted-printable: =
=
Linkedin Profile =
=
http://www.linkedin.com/in/unixgr =
=
=
=
Personal Web Site =
http://www.unix.gr =
=
=
Blog Site =
http://angelos-proverbs.blogspot.com
x-mozilla-html:FALSE
url:http://www.linkedin.com/in/unixgr
version:2.1
end:vcard


--------------060606040407050602020904
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--------------060606040407050602020904--

Re: Read file names as per Windows file listing order

am 09.07.2009 12:34:43 von Ingo Schwarze

Hi Ramkumar,

Ramkumar wrote on Thu, Jul 09, 2009 at 01:14:31PM +0530:

> Please suggest if you have any idea to achive my requirement in perl.

An easier solution than the one already suggested might be
to use the perl builtin functions glob(3p) and sort(3p),
in particular the "sort BLOCK" form.

See

$ perldoc -f glob
$ perldoc -f sort

for details.

In case you want to process such file names further, pay attention not
to pass them to the one-argument forms of exec(3p) or system(3p).
White space in file names will usually wreak havoc when naively passed
to the shell...

Yours,
Ingo
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Read file names as per Windows file listing order

am 09.07.2009 14:32:39 von eroode

On Thursday, July 09, 2009 6:35 AM, Ingo Schwarze wrote:

> Hi Ramkumar,
>
> Ramkumar wrote on Thu, Jul 09, 2009 at 01:14:31PM +0530:
>
> > Please suggest if you have any idea to achive my requirement in
perl.
>
> An easier solution than the one already suggested might be
> to use the perl builtin functions glob(3p) and sort(3p),
> in particular the "sort BLOCK" form.
>
> See
>
> $ perldoc -f glob
> $ perldoc -f sort
>
> for details.

Your help is accurate from a certain point of view, but does not
really advance Rakumar toward an answer. You suggest "sort
BLOCK"... but what would you put *into* that BLOCK?

I can't think of any solution off the top of my head, without getting
insanely complex. Is there a CPAN module that provides this sort
behavior?

-- Eric Roode

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Read file names as per Windows file listing order

am 09.07.2009 14:34:47 von eroode

From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
Angelos Karageorgiou
On Thursday, July 09, 2009 4:29 AM, Angelos Karageorgiou wrote:
>
> Ramkumar wrote:
> >
> > Please suggest if you have any idea to achive my requirement in
perl.
>
> perldoc find2perl
>
> and then edit the wanted function that it emits!
>
> Good luck

How exactly does that help Ramkumar get the files sorted in the order
he desires?

-- Eric Roode

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Read file names as per Windows file listing order

am 09.07.2009 14:45:14 von Serguei Trouchelle

Roode, Eric wrote:

>> An easier solution than the one already suggested might be
>> to use the perl builtin functions glob(3p) and sort(3p),
>> in particular the "sort BLOCK" form.

> Your help is accurate from a certain point of view, but does not
> really advance Rakumar toward an answer. You suggest "sort
> BLOCK"... but what would you put *into* that BLOCK?

my @files = sort { my ($a1, $b1) = ($a, $b); $a1 =~ s/\D//g; $b1 =~ s/\D//g; $a1 <=> $b1 } readdir $DIR;

--
Serguei Trouchelle
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Read file names as per Windows file listing order

am 09.07.2009 15:48:34 von Conor Lillis

my @allfiles=sort(grep(!/^\.\.?$/, readdir DIR));


-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
Ramkumar
Sent: 09 July 2009 08:45
To: activeperl@listserv.ActiveState.com
Subject: Read file names as per Windows file listing order

Hi All,

In windows explorer, files in a folder displaying (name sort) as,
Chapter 1.doc Chapter 2.doc Chapter 3.doc Chapter 4.doc Chapter 12.doc
Chapter 20.doc Chapter 21.doc Chapter 30.doc Chapter 31.doc Chapter
40.doc Chapter 41.doc Chapter 42.doc

I need the above list/result using Perl. But Perl gives result as below,
Chapter 1.doc Chapter 12.doc Chapter 2.doc Chapter 20.doc Chapter 21.doc
Chapter 3.doc Chapter 30.doc Chapter 31.doc Chapter 4.doc Chapter 40.doc
Chapter 41.doc Chapter 42.doc

I have tried (3 different ways) the below code:

(1) opendir(DIR, $folderpath) || die "Error in opening dir $dirname\n";
while(($filename = readdir(DIR)))
{print("$filename\n");}
closedir(DIR);
(2) @xmlfiles =
File::Find::Rule->file()->name('*.doc')->in($folderpath);
(3) system("dir/b >\"$folderpath\\TextFiles.txt\"");

Please suggest if you have any idea to achive my requirement in perl.

Regards,
Ramkumar,


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


************************************************************ **********
Private, Confidential and Privileged. This e-mail and any files and attachments transmitted with it are confidential and/or privileged. They are intended solely for the use of the intended recipient. The content of this e-mail and any file or attachment transmitted with it may have been changed or altered without the consent of the author. If you are not the intended recipient, please note that any review, dissemination, disclosure, alteration, printing, circulation or transmission of this e-mail and/or any file or attachment transmitted with it, is prohibited and may be unlawful. If you have received this e-mail or any file or attachment transmitted with it in error please notify Anglo Irish Bank Corporation Limited, Stephen Court, 18/21 St Stephen's Green, Dublin 2, Ireland, telephone no
: +353-1-6162000.
Directors: D O'Connor (Chairman), F Daly, A Dukes, M Keane, D Quilligan.
Registered Office: Stephen Court, 18/21 St Stephen's Green, Dublin 2 Ireland
Registered in Ireland: No 22045
Anglo Irish Bank Corporation Limited is regulated by the Financial Regulator. Anglo Irish Bank Corporation Limited (trading as Anglo Irish Bank Private Banking) is regulated by the Financial Regulator. Anglo Irish Assurance Company Limited is regulated by the Financial Regulator.
************************************************************ **********

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Read file names as per Windows file listing order

am 09.07.2009 15:53:45 von Conor Lillis

Ignore previous mail, just tested, d'oh !!!

;-(


-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Conor
Lillis
Sent: 09 July 2009 14:49
To: ramkumar@premediaglobal.com; activeperl@listserv.ActiveState.com
Subject: RE: Read file names as per Windows file listing order

my @allfiles=sort(grep(!/^\.\.?$/, readdir DIR));


-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
Ramkumar
Sent: 09 July 2009 08:45
To: activeperl@listserv.ActiveState.com
Subject: Read file names as per Windows file listing order

Hi All,

In windows explorer, files in a folder displaying (name sort) as,
Chapter 1.doc Chapter 2.doc Chapter 3.doc Chapter 4.doc Chapter 12.doc
Chapter 20.doc Chapter 21.doc Chapter 30.doc Chapter 31.doc Chapter
40.doc Chapter 41.doc Chapter 42.doc

I need the above list/result using Perl. But Perl gives result as below,
Chapter 1.doc Chapter 12.doc Chapter 2.doc Chapter 20.doc Chapter 21.doc
Chapter 3.doc Chapter 30.doc Chapter 31.doc Chapter 4.doc Chapter 40.doc
Chapter 41.doc Chapter 42.doc

I have tried (3 different ways) the below code:

(1) opendir(DIR, $folderpath) || die "Error in opening dir $dirname\n";
while(($filename = readdir(DIR)))
{print("$filename\n");}
closedir(DIR);
(2) @xmlfiles =
File::Find::Rule->file()->name('*.doc')->in($folderpath);
(3) system("dir/b >\"$folderpath\\TextFiles.txt\"");

Please suggest if you have any idea to achive my requirement in perl.

Regards,
Ramkumar,


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


************************************************************ **********
Private, Confidential and Privileged. This e-mail and any files and
attachments transmitted with it are confidential and/or privileged. They
are intended solely for the use of the intended recipient. The content
of this e-mail and any file or attachment transmitted with it may have
been changed or altered without the consent of the author. If you are
not the intended recipient, please note that any review, dissemination,
disclosure, alteration, printing, circulation or transmission of this
e-mail and/or any file or attachment transmitted with it, is prohibited
and may be unlawful. If you have received this e-mail or any file or
attachment transmitted with it in error please notify Anglo Irish Bank
Corporation Limited, Stephen Court, 18/21 St Stephen's Green, Dublin 2,
Ireland, telephone no: +353-1-6162000.
Directors: D O'Connor (Chairman), F Daly, A Dukes, M Keane, D Quilligan.
Registered Office: Stephen Court, 18/21 St Stephen's Green, Dublin 2
Ireland Registered in Ireland: No 22045 Anglo Irish Bank Corporation
Limited is regulated by the Financial Regulator. Anglo Irish Bank
Corporation Limited (trading as Anglo Irish Bank Private Banking) is
regulated by the Financial Regulator. Anglo Irish Assurance Company
Limited is regulated by the Financial Regulator.
************************************************************ **********

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Read file names as per Windows file listing order

am 10.07.2009 00:07:05 von Jan Dubois

On Thu, 09 Jul 2009, Ramkumar wrote:
> In windows explorer, files in a folder displaying (name sort) as,
> Chapter 1.doc
> Chapter 2.doc
> Chapter 3.doc
> Chapter 4.doc
> Chapter 12.doc
> Chapter 20.doc
> Chapter 21.doc
> Chapter 30.doc
> Chapter 31.doc
> Chapter 40.doc
> Chapter 41.doc
> Chapter 42.doc
>
> I need the above list/result using Perl. But Perl gives result as below,

Explorer uses the StrCmpLogicalW() function in shlwapi.dll to sort filenames
into "logical" order. The exact sort order is not guaranteed and may change
with each Windows release or service pack! You can call it from Perl if you
are using Windows XP or later. See sample code below.

Cheers,
-Jan

#!perl
use strict;
use warnings;
use Encode qw(encode);
use Win32::API;

my $cmp_logical = Win32::API->new("shlwapi.dll", "StrCmpLogicalW", "PP", "I");
die "Needs shlwapi.dll version 5.5 or later\n" unless defined $cmp_logical;

sub cmp_logical {
return $cmp_logical->Call(encode("UTF-16LE", $a), encode("UTF-16LE", $b));
}

my @names = ;
print for sort cmp_logical @names;

__DATA__
Chapter 1.doc
Chapter 12.doc
Chapter 2.doc
Chapter 20.doc
Chapter 21.doc
Chapter 3.doc
Chapter 30.doc
Chapter 31.doc
Chapter 4.doc
Chapter 40.doc
Chapter 41.doc
Chapter 42.doc


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

RE: Read file names as per Windows file listing order

am 11.07.2009 08:16:05 von EwenMarshall

Is there a similar function to sort by file age using shlwapi.dll?

Cheers,

Ewen

-----Original Message-----
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of Jan Dubois
Sent: 09 July 2009 23:07
To: ramkumar@premediaglobal.com; activeperl@listserv.ActiveState.com
Subject: RE: Read file names as per Windows file listing order

On Thu, 09 Jul 2009, Ramkumar wrote:
> In windows explorer, files in a folder displaying (name sort) as,
> Chapter 1.doc
> Chapter 2.doc
> Chapter 3.doc
> Chapter 4.doc
> Chapter 12.doc
> Chapter 20.doc
> Chapter 21.doc
> Chapter 30.doc
> Chapter 31.doc
> Chapter 40.doc
> Chapter 41.doc
> Chapter 42.doc
>
> I need the above list/result using Perl. But Perl gives result as below,

Explorer uses the StrCmpLogicalW() function in shlwapi.dll to sort filenames
into "logical" order. The exact sort order is not guaranteed and may change
with each Windows release or service pack! You can call it from Perl if you
are using Windows XP or later. See sample code below.

Cheers,
-Jan

#!perl
use strict;
use warnings;
use Encode qw(encode);
use Win32::API;

my $cmp_logical = Win32::API->new("shlwapi.dll", "StrCmpLogicalW", "PP",
"I");
die "Needs shlwapi.dll version 5.5 or later\n" unless defined $cmp_logical;

sub cmp_logical {
return $cmp_logical->Call(encode("UTF-16LE", $a), encode("UTF-16LE",
$b));
}

my @names = ;
print for sort cmp_logical @names;

__DATA__
Chapter 1.doc
Chapter 12.doc
Chapter 2.doc
Chapter 20.doc
Chapter 21.doc
Chapter 3.doc
Chapter 30.doc
Chapter 31.doc
Chapter 4.doc
Chapter 40.doc
Chapter 41.doc
Chapter 42.doc


_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Re: Read file names as per Windows file listing order

am 11.07.2009 16:42:36 von Bill Luebkert

Ewen Marshall wrote:
> Is there a similar function to sort by file age using shlwapi.dll?

Why not just stat the files in a loop and get the mtime or ctime
and make a hash and sort the hash on the time value ? It shouldn't
be that much more overhead and you can do it the way you want.
Same with the name sort - Windows sort order is somewhat illogical
anyway.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs