LoadDir/ReadDir not working
BlitzMax Forums/BlitzMax Programming/LoadDir/ReadDir not working
| ||
LoadDir always returns null, no matter what path it's given. The LoadDir example code does this, too. ReadDir returns a valid handle, but NextFile always returns a blank string. This is on Windows 8 and using BlitzMax 1.50. Is there something I might be doing wrong? |
| ||
Did you install BlitzMax to C:/BlitzMax? Certain folders in Windows since Vista get a bit picky about user permissions which may be the cause of the example code not working. |
| ||
Both examples work fine for me. Using Windows 8.1 64bit and BMax 1.50 |
| ||
Ive had this problem as well. LoadDir will return an array of 0 strings. There dossnt seem to be any reason for this behavior. Ive constructed a workaround as the files were of images. I use tilesets and LoadAnimImage () to store them in a TImage object. |
| ||
I've been using it in my project for the last year and it's been fine but it just suddenly stopped working for me. I can run an archived exe but if I recompile the same code it now crashes since ReadDir is returning a directory with no files in it. The example snippet also returns nothing. Windows 8 64bit BMax 1.48. --> FIX : I just uninstalled / installed BMax 1.50 and it functions correctly. So I dunno if it was the reinstall or the upgrade, but I'm relieved that it works. |
| ||
Have you been making a module at all? If so, then choose 'Rebuild all modules'. Thats the first thing I would do. |
| ||
I also have this problem... what you can do is build all modules first.... then reinstall bmax 1.50 and it works... For every time you build modules you have to reinstall bmax 1.50 to make it work again... :| |
| ||
Still no solution or workaround? I really need this functionality. |
| ||
Hiya, Did you try 'rebuilding all modules'? |
| ||
Here are two example exe's and the source : list_test.zip 100kb You can run them from the command line. Without any args it lists the current directory, or you can pass a path in and it will list that. list.exe is built with BlitzMax 1.50 and TDM MinGW 4.8.1 list_ng.exe is built with a c-based version of BlitzMax on slightly modified 1.50 modules, and TDM MinGW 4.8.1 Built on Windows 7 Pro, 64-bit. Source is provided so you can build it yourself too. Example output: C:\Users\brucey\000_programming\BlitzMax_NG\src>list_ng List : C:/Users/brucey/000_programming/BlitzMax_NG/src . .. .bmx flag.png gfx1.bmx gfx1.exe helloworld.bmx helloworld.exe list list.bmx list.bmx.bak list.debug.exe list_ng.exe list_test.zip pngload.bmx pngload.bmx.bak pngload.exe |
| ||
Running the application lists the files like it should. Building on Windows 8 64-bit using Blitzmax 1.50, no files are listed. Strangely, it seems to work fine using Blitzmax 1.40. |
| ||
Great. Would you be so kind as to send me the exe's (for both debug and release), as well as the .bmx folder (which contains the generated assembler). And perhaps also your brl.filesystem folder (mod/brl.mod/filesystem.mod) (including its .bmx folder). And some other useful information, like what (if any) MinGW version you have installed. Thanks! :-) |