How to join a path to a file in code, "windows safe"
Just use / as path separator: It will work on Windows, and any other OS. 

PHP defines the DIRECTORY_SEPARATOR constant, but that constant is not used from Drupal core code, and Drupal works on Windows too.
A note on the parameters accepted from basename() says:


  On Windows, both slash (/) and backslash (\) are used as directory separator character. In other environments, it is the forward slash (/).