I’m working on writing rotation information of several objects to a text file, and then in turn reading them back. Following the tutorials from scriptswell I was able to read from a file, but writing to it has cause a bit of a stumble. When I run the following lines of code (Subbing out the path and file with an actual file and path):
proc myProc(){
string $myString = "Hello World";
string $myFilePath = "C:/PATHNAME/FILENAME.txt";
$myFileID = `fopen $myFilePath "a"`;
fprint $myFileID ($myString);
}
I get this error:
// Warning: line 4: fopen: unable to open file "C:/PATHNAME/FILENAME.txt" for mode "a". //
This also happens if I swap the append mode for write, but with the error saying it can’t open for mode w. I am able to read from this file just fine, I’ve tried placing it in the scene folder of the current project, and running Maya as administrator, and neither has made a difference.
I’m going to try on a different machine, and see if I can get that going, but any advice would be welcome!