ScriptSpot

Forum topic · General Scripting

openFile is locking file access

By meatshield · 2007-05-05

Description

I am using openFile and filestreams to successfully modify XML files.

However, I cannot get Max to release control of these files on a system level once they have been modified without closing max.

Not a huge deal, but if i would like to edit any of these recently modified XML files in a text editor, I have to close Max.

I flush and close the filestream when my script is through.

Some of the openFile modes are vague to me ("S", "R", "T", "D", "c" and "n"), I wonder if that's my problem.

Any suggestions?

Comments (2)

That's because your file is

vasilescu_anton · 2007-08-28

That's because your file is still open in max's memory. Once you close max you terminate the connection. The way to do it is using the "close <filestream>" command to flush the memory and close the file.

One other way to force closing is using "gc()" which clears all memory.

abyjoe · 2007-07-22

i am having a similar problem... any ideas??? please reply