Game Development Community

isFile problem

by Bruce Morick · in Torque 2D Beginner · 03/11/2016 (3:36 pm) · 4 replies

is there a way to fix this problem? Some command to execute?


==>echo(isfile(getuserdatadirectory()@"/ALIVE.dat"));
1

manually deleted the file in windows - not exiting TORQUE2d

==>echo(isfile(getuserdatadirectory()@"/ALIVE.dat"));
1

Shouldn't it return 0?

#1
03/11/2016 (4:13 pm)
File accesses go through the ResManager(Resource Manager). And because ResManager does file lookup caching you won't be able to determine if a previously existed file was deleted or not, without trying to open it as read only first and checking for an error to know whether or not it exists by if it succeeded or failed to open the file.
#2
03/11/2016 (5:22 pm)
Thanks... I'll try that...
#3
03/11/2016 (6:24 pm)
Yeah - it's odd that they don't just use Platform::isFile() in that script function.
#4
04/07/2016 (8:53 am)
Sounds like a pull request just waiting to happen...