What the DIRECTORY() function returns?
I see You use SET DEFAULT only to check if the directory exists. There is no need to do that, if the DIRECTORY function retuns .T., in other hand if DIRECTORY() returns .t. & You can't create file there may be You haven't enough rights.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.