writeFile Error

Can someone tell me why I’m getting this error when running this scripting function? system.file.writeFile, isn’t it supposed to create the file if it doesn’t exist?

IOError: The system cannot find the path specified

Java ‘translates’ low level filesystem errors into Java errors, and sometimes loses information or throws inaccurate or misleading errors. Can you provide your script/the path you’re trying to write to? This could actually be a permissions error or something along those lines.

I’ve noticed that if I create the directory I’m writing files to before hand, it’ll write the files.
Can this function not create the directory for me?

It can if the user running the Ignition service has admin rights. It could fail otherwise.