<font face="courier new,monospace"><br></font><br><div class="gmail_quote">On Thu, May 10, 2012 at 1:30 PM, <span dir="ltr"><<a href="mailto:rob@cryptic.org" target="_blank">rob@cryptic.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Further to that, "." actually is a special-case directory, similar to "..". Like a double period is "parent directory", a single period is "current directory". It's like this on both Unix and Windows (and presumably Mac).</blockquote>
<div><br>Actually its both a special case filename and a directory.<br>My trouble is that as far as File::Spec is concerned '.' and '..' are returned as the filename<br>... which is technically correct, BUT if thats all that was provided,<br>
it really means 'this' or 'the parent' directory [not a filename]<br><br>As a result, I'd think the directory wasn't provided and substitute my own, and use the<br>filename provided and end up with "/defdir/."<br>
... which would be _completely_ wrong.<br><br>If someone gave me '.' as their 'target' you'd want to interpret that as<br>"they want it to be in the 'default' file in _this current_ directory" ie. ./deffile<br>
<br><br>So in either case... these libraries still don't do it correctly (for my needs)<br><br>I've ended up using a combo of special case tests for '.' and '..'<br>[meaning this (or parent directory) with no filename provided];<br>
otherwise use File::Basename to extract the filename and<br>extract any stuff in front of the filename as the directory path<br> (and ignore what File::Basename provides)<br>and then finally apply my default path (if the prefix/dirpath was empty)<br>
and default filename (if filename was empty)<br>and then splice them back together again using File::Spec::catfile()<br><br><br><br></div></div><br>