I tried to explain how. FILE is a predefined constant in PHP, always pointing at the current file being processed. In some cases it might be to extreme, because if what currently is being parsed is an include, FILE will point to this include file rather than the script doing the include, if this is undesired behaviour, use $SCRIPT_FILENAME.
Anyway, if you actually spend 10 seconds looking at the manual entry for dirname() you will understand how it works; here's an example taken directly from the manual:
$path = "/etc/passwd";
$file = dirname ($path); // $file is set to "/etc"
As you can see, no trailing slash, and in most cases you will probably want the slash, thus i would write the second line as:
$file = dirname($path).'/';
Hope this helps