I am often working with files and I always get myself in a bit of a knot around what to name my varialbes when I am working with directories and files.
This is the standard that I use:
- filePath – This is the variable that gives you the directory path to a file e.g. c:\temp
- fileName – This is the name of a file, just the filename with no folder path. e.g. test.log
- file – This is the full filepath and file name for the file, e.g. c:\temp\test.log
Using this standard leads to some consistency when trying to read my code.