Passing the path to the constructor of each class is what's known as dependency injection, and it's generally considered the preferable way of doing things, at least at a simple level. The ideal solution would be to inject an instance of a file writer interface into each class as that way you can test each class using a mock writer. That is more complex to implement though. Either way, dependency injection is being used.
By using a global value, you couple all parts of your code to that value. Such coupling should be avoided as it leads to brittle code that can easily break when changes are made. The reason being, that in a large system it can be hard to identify all dependencies on a global item and thus understand the consequences of changing it.