I often define a constant and put it in the config script that gets included w/ every page:
define( 'DATA', '/path/to/my/data/directory');
then I can say, for example
fopen( DATA . '/myfile', 'a' );
Since its a defined constant I don't have to worry about visibility (scope) using it inside classes or function calls.