On Wednesday 26 July 2006 00:59, Rob Dixon wrote:
> Hello Alan
>
> Alan_C wrote:
> > On Tuesday 25 July 2006 15:56, Rob Dixon wrote:
> >>Nishi Bhonsle wrote:
[ snip ]
> > [ snip ]
[ snip ]
> > #!/usr/bin/perl
> >use strict;
> >use warnings;
> >
> >my @dir = do {
> > # opend
Hello Alan
Alan_C wrote:
>
> On Tuesday 25 July 2006 15:56, Rob Dixon wrote:
>
>>Nishi Bhonsle wrote:
>>
>> > I got the last soln, ie to use File::Basename module. Please ignore the
>> > last thread.
>> >
>> > I am still interested to know why Rob's soln doesnt work for me?
>>
>>So was I, and it'
On Tuesday 25 July 2006 15:56, Rob Dixon wrote:
> Nishi Bhonsle wrote:
> > I got the last soln, ie to use File::Basename module. Please ignore the
> > last thread.
> >
> > I am still interested to know why Rob's soln doesnt work for me?
>
> So was I, and it's because I made a mistake. Because t
"Nishi Bhonsle" schreef:
[don't! top-post!]
> [IO:All]
> Currently, it prints
> C:\..\..\..\File1.txt
> etc
> I really want it only print File1.txt
I don't understand how you read the documentation. Just search for
'filename'.
And start to grok the 'All' in IO::All.
--
Affijn, Ruud
"Gewoon i
Nishi Bhonsle wrote:
>
> I got the last soln, ie to use File::Basename module. Please ignore the
> last thread.
>
> I am still interested to know why Rob's soln doesnt work for me?
So was I, and it's because I made a mistake. Because the values returned by
readdir don't include a full path, the
I got the last soln, ie to use File::Basename module. Please ignore the last
thread.
I am still interested to know why Rob's soln doesnt work for me?
Thanks much!
On 7/25/06, Nishi Bhonsle <[EMAIL PROTECTED]> wrote:
Hi:
In addition can i modify the all_files to return only the absolute
fil
Hi:
In addition can i modify the all_files to return only the absolute filename
and not the filename alongwith the entire path?
Currently, it prints
C:\..\..\..\File1.txt
etc
I really want it only print File1.txt
Thanks!
On 7/25/06, Nishi Bhonsle <[EMAIL PROTECTED]> wrote:
Yes, all_files wo
Yes, all_files works. Its in the doc, and i missed it. Its my bad.
Rob, I tried the code snippet you mentioned, apparently it doesnot return
anything under the directory.
Thanks, Nishi.
On 7/25/06, Dr.Ruud <[EMAIL PROTECTED]> wrote:
Rob Dixon schreef:
>use strict;
>use warnings;
>
>
Rob Dixon schreef:
>use strict;
>use warnings;
>
>my @dir = do {
> opendir my $dh, 'C:\build\Sample\NewDir' or die $!;
> grep -f, readdir $dh;
For newbies, maybe put a comment here that the closedir() is implicit.
>};
>
>print "$_\n" foreach @dir;
--
Affijn, Ruud
Nishi Bhonsle wrote:
>
> I am not able to get the files at just the first level.
> ie
> print "$_\n" for $io->all(0); prints all level down
> and
> print "$_\n" for $io->all(1); prints the files and the dir name at the
> first level
> ie
> issuing the command for path C:\build\Sample\NewDir
> p
"Nishi Bhonsle" schreef:
> I am not able to get the files at just the first level.
> ie
> print "$_\n" for $io->all(0); prints all level down
> and
> print "$_\n" for $io->all(1); prints the files and the dir name at
> the first level
"All" and "all(0)" are the same.
"all" and "all(1)" are t
On 07/24/2006 06:35 PM, Nishi Bhonsle wrote:
Hi:
If I need to get the files without the "." and the ".." at the first level
only, [...]
use File::Slurp;
my @files = read_dir('mydirectory');
Do you have the perl documentation installed?
This should give you information about File::Slurp:
perl
Hi:
I am not able to get the files at just the first level.
ie
print "$_\n" for $io->all(0); prints all level down
and
print "$_\n" for $io->all(1); prints the files and the dir name at the
first level
ie
issuing the command for path C:\build\Sample\NewDir
prints the below
C:\build\Sample\NewDi
"Nishi Bhonsle" schreef:
> If I need to get the files without the "." and the ".." at the first
> level only, then how can i modify the find command?
> ie
> Currently using find(sub {push(@new,$_) if ( -f ) }, $path); gives
> me all files under NewDir as well as NewSubDirectory
> C:\build\Sample
Hi:
If I need to get the files without the "." and the ".." at the first level
only, then how can i modify the find command?
ie
Currently using find(sub {push(@new,$_) if ( -f ) }, $path); gives me all
files under NewDir as well as NewSubDirectory
C:\build\Sample\NewDir\File1.txt
C:\build\Sample\
"Wagner, David --- Senior Programmer Analyst --- WGO" schreef:
> if ( !/^\.{1,2}/ )
That would fail "..x" &c.
If you are only interested in files and not directories, use -f.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-
That works like a charm, thanks!
-Nishi.
On 7/21/06, Wagner, David --- Senior Programmer Analyst --- WGO <
[EMAIL PROTECTED]> wrote:
Nishi Bhonsle wrote:
> I tried it but didnt work.
> my @new;
>
> find(sub {push @new, $_}, $path);
find(sub {push(@new,$_) if ( !/^\.{1,2}/ ) }, $path);
Wagner, David --- Senior Programmer Analyst --- WGO wrote:
> Nishi Bhonsle wrote:
>> I tried it but didnt work.
>> my @new;
>>
>> find(sub {push @new, $_}, $path);
> find(sub {push(@new,$_) if ( !/^\.{1,2}/ ) }, $path);
>
> If not 1 or 2 periods push on to @new;
> Wags ;)
So
Nishi Bhonsle wrote:
> I tried it but didnt work.
> my @new;
>
> find(sub {push @new, $_}, $path);
find(sub {push(@new,$_) if ( !/^\.{1,2}/ ) }, $path);
If not 1 or 2 periods push on to @new;
Wags ;)
>
> open FILE,">>$logfile";
>
> print FILE "$_\n" foreach @new;
> close FI
I tried it but didnt work.
my @new;
find(sub {push @new, $_}, $path);
open FILE,">>$logfile";
print FILE "$_\n" foreach @new;
close FILE;
In addition to printing filenames and directories, it also printed the "."
The log file contained
.
file1.txt
file2.txt
How can I not include the "." ?
Nishi Bhonsle wrote:
Hi:
I am starting a new thread based of an older thread just because there
was a
lot of different things that were requested for and it had gotten a bit
confusing.
I got a lot of help from all you experts to write the below code that takes
an argument path C:\build\Sample\
Le jeu, jui 20, 2006 at 09:36:02 -0700, Nishi Bhonsle a tapoté sur son clavier :
> Hi:
> I am starting a new thread based of an older thread just because there was a
> lot of different things that were requested for and it had gotten a bit
> confusing.
>
> I got a lot of help from all you experts
22 matches
Mail list logo