ScriptSpot home

Forum topic · General Scripting

Why MaxScript does not release the files using the function Close()? Почему MaxScript не освобождает файлы с помощью функции Clo

By Nikolay Litvinov · 2015-03-11

Description

Comments (11)
IN_human

You may have problems with file access rights.
To work with MAXscript you may need administrative privileges and run 3DS MAX as Administrator. Try disabling UAC also.

pixamoon

hmm

here it works fine

after close and free, file is not locked to 3dsmax anymore.

did you try on other machines, systems or max versions ?

Reply to pixamoon
Branko Živković

That's why I prefere XML for data storage. It's much faseter and eficient for sure

Reply to pixamoon
Nikolay Litvinov

I have checked. Not only on this machine but on other.
3dMax 2012

Reply to Nikolay Litvinov
pixamoon

re:ver

hmm, I checked here in win7 max2009 and max2014. it works in both for me :(

Did you try

gc()

?

Reply to Nikolay Litvinov
pixamoon

around

oki, you can try the way around using Unlocker :)


fPath = "C:\\tmp.txt"
f = createfile fPath
close f
free f
shellLaunch "C:\\Program Files\\Unlocker\\Unlocker.exe" ("\"" + fPath + "\" /S")

Does it help ?

ah, if you use Windows 8, maybe try different location than root "c:\" and system folders.

Reply to pixamoon
Nikolay Litvinov

Oh thank you so much! :) It Works!

And how i not thought of it! :)