<font style="font-family:courier new,monospace" face="courier new,monospace">I'm looking for a good library to split a filespec into directory<br>and filename components; so I can:<br><br>a) add a default dirspec if one wasn't provided<br>
b) add a default filename if one wasn't provided<br>c) create the required directory path if it didn't already exist<br><br>So far I've tried <br><br>File::Basename and File::Spec<br><br>Unfortunately they both mis-behave?<br>
<br>File::Basename always provides a dirspec even if the original string didn't have one<br>(so I can't tell if I need to insert my default one...)<br><br>and</font><font style="font-family:courier new,monospace" face="courier new,monospace"> File::Spec (as far as I'm concerned) incorrectly splits '/.' into<br>
the directory of '/.' with no file name. I would have expected the<br>directory to be '/' and the filename to be '.'.<br><br></font><span style="font-family:courier new,monospace">Am I wrong?</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">Is there a better library?</span><br><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">[I suppose I could just take the filename from File::Spec and manually<br>
extract everything</span><span style="font-family:courier new,monospace"> in front of it from the original string as the directory<br>and simply _ignore_ what the module tells me.]<br><br>... and yes, I will eventually also need to parse DOS filespecs.<br>
<br><br><br><br style="font-family:courier new,monospace"></span>