coreybutler / node-windows

Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Other
2.8k stars 356 forks source link

appendFileSync not working as a service #152

Closed ejbones closed 7 years ago

ejbones commented 7 years ago

Hey guys, The service works great, logs in the daemon subfolder, and also does an fs.writeFileSync in a subfolder. However, my fs.appendFileSync commands that write to a file in the main folder do nothing only when run as a service.

I googled and looked but don't really have an idea where to start. The folder permissions are the same for all the folders.

file structure: folder1{program.js, nonworkingfsappendfile.txt, daemonfolder{daemon.exe, workingservice.out.logfile}, datafolder{workingfswritefilesyncfiles.txt} }

Edit: running windows 7. Folder is a google drive folder if that matters.

ejbones commented 7 years ago

Of course....it's because the run directory is different since it's running out of the daemon folder. :)

I just used the full file path and it works.