Obviously I know the difference between a file and a directory :) I also know that both a file and a directory have a path.
But when writing code, what will you use when?
E.g.:
I want to clear all *.js files in a directory...
$filesystem->removeJsFiles($jsDir|$jsPath);
Copy an XML file...
$filesystem->copy($xmlFile|$xmlPath);
So when will you typically use $path as a variable instead of $dir or $file (or the other way around)?
If you don't need to distinguish between filenames, paths and file handles I would use simply jsDir and xmlFile. Otherwise I would use jsDirName or jsDirPath and xmlFileName or xmlFilePath, and jsDir and xmlFile for file handles.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With