From 66206a2414a2c21799b316f49024a4c9f0a5511a Mon Sep 17 00:00:00 2001 From: Matthew Wilson Date: Tue, 3 Jan 2006 05:20:05 +0000 Subject: [PATCH] last of previous fix. --- lib/WebGUI/Storage.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/WebGUI/Storage.pm b/lib/WebGUI/Storage.pm index fa950f3f6..a972d549e 100644 --- a/lib/WebGUI/Storage.pm +++ b/lib/WebGUI/Storage.pm @@ -299,7 +299,7 @@ Copies a storage location and it's contents. Returns a new storage location obje sub copy { my $self = shift; my $newStorage = WebGUI::Storage->create; - my $filelist = $self->getFiles; + my $filelist = $self->getFiles(1); foreach my $file (@{$filelist}) { my $source = FileHandle->new($self->getPath($file),"r"); if (defined $source) { @@ -509,20 +509,25 @@ sub getFileSize { #------------------------------------------------------------------- -=head2 getFiles ( ) +=head2 getFiles ( showAll ) Returns an array reference of the files in this storage location. +=head3 showAll + +Whether or not to return all files, including ones with initial periods. + =cut sub getFiles { my $self = shift; + my $showAll = shift; my @list; if (opendir (DIR,$self->getPath)) { my @files = readdir(DIR); closedir(DIR); foreach my $file (@files) { - unless ($file =~ m/^\./) { # don't show files starting with a dot + if ($showAll || $file !~ m/^\./) { # don't show files starting with a dot, unless we're supposed to show all files. push(@list,$file); } }