[Raleigh-talk] Mysterious GLOB files
Marc Wiatrowski
wia at iglass.net
Wed Jan 3 14:11:17 PST 2007
What directory is it creating these GLOB files in? $baseDir? What are some of the directory,
subdirectory, and
file names? Any funky special characters in them?
My guess is some how you are creating files named after your actual file (directory) handles,
$handle_dir and/or
$sub_handle_dir, and/or $xls_handle_dir. Maybe sneaking into the second parameter of your mv system
call...
Any more of the script that may be reusing those variables?
marc
_____
From: raleigh-talk-bounces+wia=iglass.net at pm.org [mailto:raleigh-talk-bounces+wia=iglass.net at pm.org]
On Behalf Of Jason Rice
Sent: Tuesday, January 02, 2007 2:17 PM
To: raleigh-talk at pm.org
Subject: [Raleigh-talk] Mysterious GLOB files
I have a set of scripts which cycle through some directories (on a redhat linux machine) to process
files. The code works fine, except for creating GLOB(0x.......) files when the scripts complete.
Anyone have an idea on this?
Snippet follows:
opendir my $handle_dir, $baseDir;
# Get list of server folders
my @all_files;
my @folders = grep { not /[.][.]?|.*[.]\w+/xmsi } readdir $handle_dir;
foreach my $fld (@folders) {
opendir my $sub_handle_dir, "$baseDir/$fld/processed";
my @sub_folders = grep { /\d{15}/xmsi } readdir $sub_handle_dir;
foreach my $fld2 (@sub_folders) {
opendir my $xls_handle_dir, "$baseDir/$fld/processed/$fld2/XML";
chdir "$baseDir/$fld/processed/$fld2/XML";
my @xls_files = grep { /\A.*[.]xml\z/xmsi } readdir $xls_handle_dir;
foreach my $file (@xls_files) {
# Move each file to the processed directory structure
chdir "$baseDir/$fld/processed/$fld2/";
my @args = ('mv', "$baseDir/$fld/processed/$fld2/XML/$file",
"$baseDir/$fld/processed/$fld2/XML/complete");
my $ret = system(@args);
if (!$ret) {
#Process here
}
}
closedir $xls_handle_dir;
}
closedir $sub_handle_dir;
}
closedir $handle_dir;
=======END CODE
=======BEGIN ls -l Result
-rw-r--r-- 1 root root 0 Jan 2 12:52 GLOB(0x9710bdc)
-rw-r--r-- 1 root root 0 Jan 2 12:49 GLOB(0x9d1ebdc)
-rw-r--r-- 1 root root 0 Jan 2 12:51 GLOB(0x9ee0bdc)
-rw-r--r-- 1 root root 0 Jan 2 12:50 GLOB(0x9f95bdc)
=======END ls -l Result
Thanks,
--JER
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.pm.org/pipermail/raleigh-talk/attachments/20070103/0cd09807/attachment.html
More information about the Raleigh-talk
mailing list