Hello John,
Am 2008-06-06 11:06:09, schrieb John W. Krahn:
> $ perl -le'printf "%o\n", 33279'
> 100777
>
>
> 33279 is the decimal representation of a number, and 0777 is the octal
> representation of a number. If a number has a leading zero it is
> usually displayed in octal representation.
>
Gunwant Singh wrote:
Hi,
Hello,
Let me thank you for your help. I think you guys are doing a great work, its
really appreciative.
Thanks to David and John. Now that I changed my *"perl"* code to the
following, its actually working
*use strict;
use warnings;
use File::stat;
opendir (DH,
Michelle Konzack wrote:
Hello,
Hello,
I have a similar problem but with "mode" which output weird permissions:
[ '~/bin/.perl_test_001' ]--
#!/usr/bin/perl
use strict;
use warnings;
use File::stat;
opendir(DH, "/home/michelle.konzack/bin") || die
at
C:\Documents a
nd Settings\Myself\Desktop\code\dir-op.pl line 8.
What am I doing wrong!
Thanks.
--
Gunwant Singh
---
> -Original Message-
> From: Gunwant Singh [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 04,
Wagner, David --- Senior Programmer Analyst --- WGO wrote:
From: Wagner, David --- Senior Programmer Analyst --- WGO
From: Gunwant Singh [mailto:[EMAIL PROTECTED]
9 print "$file\t$perm\n";
Then change print to
printf "$file %04o\n", $perm;
Better to do it this way:
Gunwant Singh wrote:
Hi,
Hello,
I am new to this mailing list and I am very new to PERL.
perldoc -q "What.s the difference between .perl. and .Perl.?"
So, please bear with me for my questions.
I wrote a code that lists files in a directory with the permissions. I am
coding for MS-Windows
> -Original Message-
> From: Wagner, David --- Senior Programmer Analyst --- WGO
> [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 04, 2008 11:08
> To: Gunwant Singh; beginners@perl.org
> Subject: RE: Reg. Directory listing program
>
> > -Original Mes
> -Original Message-
> From: Gunwant Singh [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 04, 2008 10:02
> To: beginners@perl.org
> Subject: Reg. Directory listing program
>
> Hi,
>
> I am new to this mailing list and I am very new to PERL. So,
>
Hi,
I am new to this mailing list and I am very new to PERL. So, please bear
with me for my questions.
I wrote a code that lists files in a directory with the permissions. I am
coding for MS-Windows.
Here is my code:
*1 use strict;
2 use warnings;
3 use File::stat();
4
5 opendir (DH, "subcode") o
On 11/3/07, AndrewMcHorney <[EMAIL PROTECTED]> wrote:
> Right now my code reads :
>
> @file_list = `cd c:\;dir c:/s`;
I think that's your problem: If you were to print that same string
you've got in backticks...
print "The command is: " . "cd c:\;dir c:/s" . "\n";
...you would see that you're
Hello
I am working on a perl script in which I want a complete directory
listing of a drive partition. How can this be done in Perl?
Right now my code reads :
@file_list = `cd c:\;dir c:/s`;
However I am getting the following error message:
Extracting files in directoryThe filename
On 6/13/07, John W. Krahn <[EMAIL PROTECTED]> wrote:
Dr.Ruud wrote:
> [EMAIL PROTECTED] schreef:
>
>> I need a program that will list all of the files in a directory.
>> Without any arguments the program will list only the files (not
>> directories) in the current directory. But I must have some
Dr.Ruud wrote:
[EMAIL PROTECTED] schreef:
I need a program that will list all of the files in a directory.
Without any arguments the program will list only the files (not
directories) in the current directory. But I must have some
command line options: [...]
Might be a 1-liner with usage of
[EMAIL PROTECTED] schreef:
> I need a program that will list all of the files in a directory.
> Without any arguments the program will list only the files (not
> directories) in the current directory. But I must have some
> command line options: [...]
Might be a 1-liner with usage of IO::All.
On Jun 12, 5:26 pm, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote:
> Looking for some help here you perl geniuses you : )
>
> I need a program
Sorry, I think you are in the wrong place. Here we help people who
want to learn Perl. (People who want bespoke ad-hoc programs written
for free are general
[EMAIL PROTECTED] wrote:
Looking for some help here you perl geniuses you : )
I need a program that will list all of the files in a directory.
Without any arguments the program will list only the files (not
directories) in the current directory. But I must have some command
line options:
-d i
On 6/12/07, Beginner <[EMAIL PROTECTED]> wrote:
snip
perldoc -f format # For an alternative way to format some
headers.
snip
I would suggest using Perl6::Form instead of the built-in format
handling. The built-in format pretty much forces you to use bad
style.
* http://
On 12 Jun 2007 at 16:26, [EMAIL PROTECTED] wrote:
> Looking for some help here you perl geniuses you : )
>
> I need a program that will list all of the files in a directory.
> Without any arguments the program will list only the files (not
> directories) in the current directory. But I must have
Looking for some help here you perl geniuses you : )
I need a program that will list all of the files in a directory.
Without any arguments the program will list only the files (not
directories) in the current directory. But I must have some command
line options:
-d if no argument is given, the
Rob Dixon schreef:
>chomp (my @files = qx($command));
>chomp @files;
Why twice?
>print "$_\n" foreach @files;
unchomp? ;)
Variant:
{ local ($\, $,) = ("\n", "\n"); print @files }
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
Fo
Ed Panni wrote:
>
> I was wondering if there is a quicker way of getting a directory listing
> from a disk. I am currently doing the following but it takes a bit of
> time if I happen to have to search multiple 250Gb drives.
>
> # Trying to locate tests on the systems disks and
Ed Panni wrote:
: I was wondering if there is a quicker way of getting a directory
: listing from a disk. I am currently doing the following but it
: takes a bit of time if I happen to have to search multiple 250Gb
: drives.
You are searching through a lot of files. Perhaps the best way
to
I was wondering if there is a quicker way of getting a directory listing
from a disk. I am currently doing the following but it takes a bit of
time if I happen to have to search multiple 250Gb drives.
#
# Trying to locate tests on the systems disks and establish paths to
them";
#
$
On Apr 21, 2004, at 6:09 AM, Ryan Thomas wrote:
I am relatively new at PERL and am learning it for a school project.
What I would like to do is write a perl script that can run a complete
directory listing including sub-directories and save the result to a
text file.
Not sure where to start
Hi Jane,
- Original Message -
From: Ryan Thomas
Sent: 21.04.2004, 11:09 Uhr
>I am relatively new at PERL and am learning it for a school project. What I
>would like to do is write a perl script that can run a complete directory
>listing including sub-directories and save the
On 21 Apr 2004, at 11:09, Ryan Thomas wrote:
I am relatively new at PERL and am learning it for a school project.
What I would like to do is write a perl script that can run a complete
directory listing including sub-directories and save the result to a
text file.
Not sure where to start
I am relatively new at PERL and am learning it for a school project. What I would like
to do is write a perl script that can run a complete directory listing including
sub-directories and save the result to a text file.
Not sure where to start.
Help!!
thanks
Jane
> -Original Message-
> From: richard noel fell [mailto:[EMAIL PROTECTED]]
> Subject: problem with directory listing
>
> Below is sample code that does not work as I intend, the
> intention being
> to list all the sub-directories in a given directory.
>
> #!/u
richard noel fell'; [EMAIL PROTECTED]
> Subject: RE: problem with directory listing
>
> Whitespace, whitespace, whitespace. Right, got that over with now let's look
> at your code (formatted so it's readable)
>
> #!/usr/local/ActivePerl-5.6/bin/perl5.6.1 -w
&g
Sorry. That should have been prepend.
-Original Message-
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: 11 April 2002 12:47
To: 'richard noel fell'; [EMAIL PROTECTED]
Subject: RE: problem with directory listing
Whitespace, whitespace, whitespace. Right, got that ove
ir_to_process \n";
}
}
closedir DH;
HTH
John
-Original Message-
From: richard noel fell [mailto:[EMAIL PROTECTED]]
Sent: 11 April 2002 13:07
To: [EMAIL PROTECTED]
Subject: problem with directory listing
Below is sample code that does not work as I intend, the intention being to
Below is sample code that does not work as I intend, the intention being
to list all the sub-directories in a given directory.
#!/usr/local/ActivePerl-5.6/bin/perl5.6.1 -w
use strict;
my $mw;
my $menubar;
my $algebra;
my @file_array;
my $dir_to_process = "/home/rfell/mathprogram";
opendir DH, $
Thanks folks, this is ANOTHER module I'm going to start using.
I have to say that this is a lot more fun than counting clock cycles, which
was the last bench-marking I did a long, long time ago...
regards,
Richard
At 19:53 7/06/2001 -0700, Peter Cornelius wrote:
>Looking at the other postin
Since someone raised the general question of differences, which is faster?
Randal's suggestion:
my @result = <*.jpg>;
or variations on:
@files = grep /jpg/i, readdir DIR;
regards,
Richard
On 7 Jun 2001, Randal L. Schwartz wrote:
> Was this on 5.6 or 5.6.1, where the glob is internalized, or on 5.5 or
> earlier, where glob called an external process?
This is on a RedHat Linux 7.1 os with 5.6.0.
--
Ian
> I got
>
> Benchmark: timing 5 iterations of Randals, variations...
>Randals: 79 wallclock secs (28.94 usr + 49.99 sys = 78.93
> CPU) @ 633.46/s
> (n=5)
> variations: 0 wallclock secs ( 0.03 usr + 0.00 sys = 0.03 CPU) @
> 166.67/s (n=5)
> (warning: too few it
> "iansmith" == iansmith <[EMAIL PROTECTED]> writes:
iansmith> On Fri, 8 Jun 2001, Richard Hulse wrote:
>> Since someone raised the general question of differences, which is faster?
>> my @result = <*.jpg>;
>> or variations on:
>> @files = grep /jpg/i, readdir DIR;
iansmith> use Benchmark;
> which is faster?
>
> Randal's suggestion:
>
> my @result = <*.jpg>;
>
> or variations on:
>
> @files = grep /jpg/i, readdir DIR;
>
Try this...
use Benchmark;
opendir (DH, ".") or die;
timethese(5, {
'Randals' => q{my @result = <*.jpg>},
'variations' => q{my @result =
On Fri, 8 Jun 2001, Richard Hulse wrote:
> Since someone raised the general question of differences, which is faster?
> my @result = <*.jpg>;
> or variations on:
> @files = grep /jpg/i, readdir DIR;
use Benchmark;
timethese(1, {
'Glob' => sub { my @result = <*.jpg>; },
'Read' => sub { opendir
Looking at the other posting to this I realize I should have included the
open and close in the test block. That makes the results...
Benchmark: timing 1 iterations of Randals, variations...
Randals: 16 wallclock secs ( 6.00 usr + 10.05 sys = 16.05 CPU) @ 622.98/s
(n=1)
variations: 3 w
On Thu, 7 Jun 2001, Peter Cornelius wrote:
> use Benchmark;
> opendir (DH, ".") or die;
> timethese(5, {
> 'Randals' => q{my @result = <*.jpg>},
> 'variations' => q{my @result = grep /\.jpg$/i, readdir DH}
> });
> closedir(DH)
This only reads the directory in once for the 'variati
At 01:45 PM 6/7/01 -0500, Shawn wrote:
>Can someone let me know what effectively is the difference between
>@files = grep {/jpe?g$/i} readdir DIR;
>and
>@files = grep /jpe?g$/i, readdir DIR;
>?
>
>Or is there any?
There isn't. Some people like to use only the block form even in those
cases wher
On Jun 7, Shawn said:
>Japhy pointed out this particular syntax to me. Before this, I was using
>@files = grep {/jpe?g$/i} readdir DIR;
>
>Can someone let me know what effectively is the difference between
>@files = grep {/jpe?g$/i} readdir DIR;
>and
>@files = grep /jpe?g$/i, readdir DIR;
If you
Japhy pointed out this particular syntax to me. Before this, I was using
@files = grep {/jpe?g$/i} readdir DIR;
Can someone let me know what effectively is the difference between
@files = grep {/jpe?g$/i} readdir DIR;
and
@files = grep /jpe?g$/i, readdir DIR;
?
Or is there any?
On 06/07, Pete E
...and just to include both .jpg and .jpeg like John's program:
opendir DIR, "./" or die "can't open $directory: $!\n";
@files = grep /jpe?g$/i, readdir DIR;
Nice code, Shawn. I must admit that my original way of doing this was even worse
than John's (by not using opendir and closedir). Zoiks. G
R);
> return(@jpeg);
> } #end get_jpg_from_dir
>
> ---
> [EMAIL PROTECTED] (Galactic Hero)
> Diplomacy: The art of saying good doggie
> while searching for a big rock.
>
> > -Original Message-
> > From: Evan McNabb [mailto:[EMAIL PROTECTED]]
&g
Thanks for the info, I got everything up and running. I've never had so
many responses in such a short amount of time, and with so many ways of
getting the job done... :-)
-Evan
Evan McNabb [EMAIL PROTECTED]
http://www.mcnabbs.org/evan
On Thu, Jun 07, 2001 at 11:16:36AM -0500, Evan McNabb wrote:
>
> I've been working on a little script for a while but I can't seem to get
> this part working. What I want to do is list all of the *.jpg files in a
> directory (ls *.jpg) and then have an array with each filename as elements
> of th
while
closedir(DIR);
return(@jpeg);
} #end get_jpg_from_dir
---
[EMAIL PROTECTED] (Galactic Hero)
Diplomacy: The art of saying good doggie
while searching for a big rock.
> -Original Message-
> From: Evan McNabb [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 07,
EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 12:17 PM
To: [EMAIL PROTECTED]
Subject: directory listing to array
I've been working on a little script for a while but I can't seem to get
this part working. What I want to do is list all of the *.jpg files in a
directory (ls *.jpg) an
@list = `ls *.jpg`;
print @list;
Evan McNabb wrote:
>
> I've been working on a little script for a while but I can't seem to get
> this part working. What I want to do is list all of the *.jpg files in a
> directory (ls *.jpg) and then have an array with each filename as elements
> of that arr
--- Evan McNabb <[EMAIL PROTECTED]> wrote:
> I've been working on a little script for a while but I can't seem to
> get this part working. What I want to do is list all of the *.jpg
> files in a directory (ls *.jpg) and then have an array with each
> filename as elements of that array. Its probab
> "Evan" == Evan McNabb <[EMAIL PROTECTED]> writes:
Evan> I've been working on a little script for a while but I can't seem to get
Evan> this part working. What I want to do is list all of the *.jpg files in a
Evan> directory (ls *.jpg) and then have an array with each filename as elements
Ev
I've been working on a little script for a while but I can't seem to get
this part working. What I want to do is list all of the *.jpg files in a
directory (ls *.jpg) and then have an array with each filename as elements
of that array. Its probably easy but I just can't get it right yet... :-)
54 matches
Mail list logo