Fix Linux permissions problems

Local directory is added to the variable x for the correct location of
the created files.
If the directory is not specified, the files are created in the root
directory.
In MSWindows X: \ and Linux \