ScriptSpot

Forum topic · General Scripting

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

By Nik · 2015-03-11

Description

Comments (11)

IN_human · 2020-04-23

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.

hmm

pixamoon · 2015-03-11

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 ?

barigazy · 2015-03-11

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

Nik · 2015-03-12

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

re:ver

pixamoon · 2015-03-12

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

Did you try

gc()

?

Yes I tried gc(), the same shit

Nik · 2015-03-14

:(

around

pixamoon · 2015-03-14

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.

Oh thank you so much! :) It Works!

Nik · 2015-03-15

And how i not thought of it! :)

great :)

pixamoon · 2015-03-16

:) great, did it work with unlocker or with different folder in win 8 ?

Unlocker

Nik · 2015-03-19

worked

`

pixamoon · 2015-03-23

great, but it still needs external unlocker... eh