<?xml version="1.0" encoding="windows-1252"?>
<node id="1007994" title="How to get full path name in windows?" created="2012-12-09 12:54:41" updated="2012-12-09 12:54:41">
<type id="115">
perlquestion</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
&lt;p&gt;
Hello Perl Monks&lt;br&gt;
I wrote a code to get the absolute paths of the files in a directory,but I get the path showing the files as present in current directory.
Eg: Here, I'm using the directory Cluster1 on the desktop with files doc.txt,volt.txt and holiday.txt. The absolute path should be C:\\Users\\Me\\Desktop\\Cluster1\\doc.txt. But, I get the output as D:\Prog\Perls\doc.txt(D:\Prog\Perls is the location where I execute my code). 
&lt;code&gt;
$dirname="C:\\Users\\Me\\Desktop\\Cluster1";
opendir(DIR, $dirname);
@FILES= readdir(DIR); 
foreach $FILE (@FILES){
$fil_path = File::Spec-&gt;rel2abs($FILE);
print "File path:", $fil_path;
}
closedir DIR;
&lt;/code&gt;
Can you suggest a way to get the absolute path of the file from its original location.(I would also like the path to have 2 escape characters(\\) as a single one doesn't work while accessing a file.)&lt;br&gt;
Thank you.
&lt;/p&gt;</field>
<field name="reputation">
15</field>
</data>
</node>
