I have a simple method below which checks to see if a directory exists. I have noticed that when **fs.lstat** get's called it creates, what looks like a *temporary file* with a name along the lines of '12116-ocskz3'

**Why does lstat create these temporary files and how can I remove them?**

```
self.checkDirectory = function (callback) {
    fs.lstat(uploadDir, function (err, stats) {
        // Linux fielsystem manual - http://linux.die.net/man/2/lstat
        if (!err && stats.isDirectory()) {

            //Directory exists
            console.log('This directory already exists!');

            if (typeof(callback) == 'function') {
                callback(true, uploadDir);
            }

        } else if (err.code === 'ENOENT') {
            // ENOENT - A component of path does not exist, or path is an empty string.
            console.log(err.code + ': This directory doesn\'t exists!');

            if (typeof(callback) == 'function') {
                callback(false, uploadDir);
            }

        }
    });
};

```