--- Telemachus Odysseos <[EMAIL PROTECTED]> wrote:
>
> #!/usr/bin/perl
>
> opendir(CD,"/path/to/directory/here");
> while ( $_ = readdir(CD)) {
> next if $_ eq "." or $_ eq "..";
> print $_, " " x (30-length($_));
> print (-s $_ );
Here you need to specify the absolute
Telemachus Odysseos wrote:
Hi,
Hello,
I have read around and cannot seem to find an answer to this, and it's
driving me a bit nuts. I have a small script that I am trying to use to list
the items in a directory and the size of the items. The script works
perfectly if I run it in the directory
On Sep 18, 1:59 pm, [EMAIL PROTECTED] (Telemachus Odysseos)
wrote:
> The script works
> perfectly if I run it in the directory itself, but if the script is
> somewhere else in my system, it prints the filenames but not the sizes.
That's because readdir returns a plain filename. You need to eithe
"Telemachus Odysseos" schreef:
> [...] it prints the filenames
> but not the sizes. [...]
perldoc -f readdir:
"you'd better prepend the directory in question".
> #!/usr/bin/perl
Missing:
use strict;
use warnings;
> opendir(CD,"/path/to/directory/here");
my $dir_name = "/path/to/dire
Hi,
I have read around and cannot seem to find an answer to this, and it's
driving me a bit nuts. I have a small script that I am trying to use to list
the items in a directory and the size of the items. The script works
perfectly if I run it in the directory itself, but if the script is
somewhere
Michael Pratt wrote:
> This is what I want to do and I dont know where to start:
>
> List files in a directory taking that list with just the filename and no
> other information
Use the glob operator of perl (perldoc -f glob)
while (<*>) {
print "$_\n";
}
This should
Michael Pratt wrote:
>
> This is what I want to do and I dont know where to start:
>
> List files in a directory taking that list with just the filename and no
> other information. using that information and populating a listbox.
Check out 'perldoc -f opendir perl'. Perhaps the File:: modules s
This is what I want to do and I dont know where to start:
List files in a directory taking that list with just the filename and no
other information. using that information and populating a listbox.
Can someone help?
Mike
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands