Hi,
I am using perl in windows platform. I have a directory structure \Dir\Data\tran\Archive\TDB\Log. There are files in the TDB directory with .dat extension. I need to parse the TDB directory inorder to identify the .dat files individually. I have the logic as follows:
# file path
$input = "\\Dir\\Data\\tran\\".$ARGV[0];
$archive = "\\Dir\\Data\\tran\\Archive\\".$ARGV[0];
$archLog = $archive."\\Log";
die "Can not open archive directory"
unless (opendir ARC, $archive);
mkdir($archLog, 0777)
unless (opendir ARCLOG, $archLog);
# moving from input to archive
$mvString = "move ".$input."\\*.dat ".$archive."\\";
#
while ($fn = readdir ARC)
{
if (substr($fn,0,1) ne "." and substr($fn,0,3) ne "Log")
{
$fn =~ /.dat/ ? $fn =~ /:|MemberTranArchive/ ? ($dummy = $fn) : &mvFile($archive,$fn) : ($dummy = $fn);
}
}
closedir ARCDIR
With this logic in place, I get . and .. (current and parent directory) and finally it jumps to Log directory. The logic never looks for the files in the TDB directory.
How to make the logic work to parse the directory TDB?
The same logic works fine on unix platform. I am trying to make it work on windows.
Am I missing something here?