<div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Apr 28, 2012 at 7:29 AM, Indy Singh <span dir="ltr"><<a href="mailto:indy@indigostar.com" target="_blank">indy@indigostar.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div dir="ltr">
<div style="font-size:12pt;font-family:'Calibri'">
<div>Hello all,</div>
<div> </div>
<div>I want to copy files from one directory to another where the directory
paths are something like:</div>
<div>/a/b/c to /x/y/z</div>
<div> </div>
<div>I need to detect if the two directory paths are identical after symbolic
links are resolved, in order to skip the file copy.</div>
<div> </div>
<div>Using File::Copy::copy sets $! to ‘No such file or directory’</div>
<div> </div>
<div>
<div>Using cp from a shell prompt gives an error like:</div>
<div>cp: `/a/b/c/foo.txt' and `/x/y/z/foo.txt' are the same file<br></div></div>
<div>
<div>Anyone have an idea how to resolve this?</div></div></div></div></div></blockquote><div><br>Can you use stat() to get the inodes of both directories to see if they are the same?<br><br><br></div></div></div>