FileExists Function Request
Monkey Forums/Monkey Programming/FileExists Function Request
| ||
I think this is really needed.FileExists (path:String) In glfw it's already possible via FileType(). In IOS i found this: http://stackoverflow.com/questions/1638834/how-to-check-if-a-file-exists-in-documents-folder Android: http://stackoverflow.com/questions/2786655/test-if-file-exists Html: http://www.codingforums.com/showpost.php?p=1155364&postcount=5 Of course it should be more efficient than loading the file with LoadString and then checking the String for "". Has anybody done this already? |
| ||
On C# there is this function: bool system.io.file.exists(filename) I supose it works out of the box on XNA |
| ||
So XNA shouldn't be a problem then :) I tried to implement the html5 code from the above link (text in red) and it seemed to work except that it still took 2ms to check a file. Out of curiosity I tried the same in BlitzMax. Using FileType() I could check 10000 (same) files in 15ms. So there has to be something wrong with the html code. |
| ||
Shinkiro1, the HTML code is slower because it spawns an XMLHTTPRequest each time it has to check for the file while the BlitzMax code actually checks using file system functions, and BTW: I suppose the underling operation system will cache your request at some point, making it lightspeed. |
| ||
I have created an fstream module long time ago. It supports: Android, GLFW, XNA(tested on WP7, and windows), and maybe iPhone as it was long time ago. It is now a part of my GUI module. I will make it into a seperate module and post it here. It can read, write, and create files. |
| ||
It can read, write, and create files. I'm very interested on this. |
| ||
Me too, that would be very very useful! It would be great if iPhone is supported as well. |
| ||
I created the module. There is no iOS support though. I guess I didn't have time to look up into it then. Here is the link: http://monkeycoder.co.nz/Community/posts.php?topic=2679 |