 	fs = require "fs"
 	leargs = ""
 	leargs+=arg for arg,i in process.argv when arg isnt "coffee" and arg isnt "node" and arg isnt __filename if includeparams
-	pidfile = __dirname + "/" + __filename.split('/').pop() + (new Buffer(leargs).toString('base64')) + '.pid'
+	path = process.env[if (process.platform == 'win32') then 'USERPROFILE' else 'HOME'] + "/.singlerun"
+	fs.mkdirSync(path) if !fs.existsSync(path)
+	pidfile = path + "/" + __filename.split('/').pop() + (new Buffer(leargs).toString('base64')) + '.pid'
 	console.log (new Buffer(leargs).toString('base64'))
 	console.log "args : ", leargs
 	process.on 'exit', (code) ->

				isrunning data,(isit)->
					if isit
						console.log __filename +' IS already running'
						process.exit 1
					else
						console.log '%s Process not found, running it (and removing pid in proces)', data
						cback()

			process.exit 0
		,1000
else
    exports = doPid
