Community
Message Board

Chat room - users
Game Over
( 394431 downloads)
Work In Progress
( 523201 downloads)
Links

Code Exchange
Downloads
Tutorials
Add to Favourites

Submit news

DIV ARENA FORUMS
Not logged in [Login - Register]
Go To Bottom

Printable Version  
Author: Subject: Possible DIV3 bug? get_fileinfo appears not to work on Windows
Casper
DIV Pro
******




Posts: 31
Registered: 18-10-2017
Member Is Offline


[*] posted on 4-2-2018 at 03:04 PM
Possible DIV3 bug? get_fileinfo appears not to work on Windows


This is my test program:

Code:
COMPILER_OPTIONS _case_sensitive; program test_get_fileinfo; const path = "assets\"; fileName = "test.dat"; global fileHandle; data = 777; result1; begin fileHandle = fopen(path + fileName, "w"); fwrite(offset data, sizeof(data), fileHandle); fclose(fileHandle); result1 = get_fileinfo(path + fileName); write_int(0, 20, 20, 0, &result1); repeat frame; until (scan_code != 0) end


The file is a simple DIV written file containing the integer value 273. When I run this program from DIV3, result1 is always 0.

[Edited on 2018-2-4 by Casper]
View user's profile View All Posts By User
MikeDX
DIV Nerd
*********


Avatar


Posts: 8388607
Registered: 25-2-2016
Member Is Offline


[*] posted on 4-2-2018 at 03:05 PM


I believe this is indeed a bug since the windows version doesn't read the filesystem correctly. I will raise an issue on github and see if i can address it this week
View user's profile View All Posts By User
Casper
DIV Pro
******




Posts: 31
Registered: 18-10-2017
Member Is Offline


[*] posted on 4-2-2018 at 03:23 PM


Thanks Mike!

I am actually struggling with a different related problem: I want to use get_dirinfo (which does work on windows) to retrieve a directory listing of one of my asset data folders. However, it appears that get_dirinfo is always executed from the DIV executables path, not the path of the program. This means I can't dynamically load data files from my game folder unless I predetermine the path in code (which won't be the same for users on another machine).

Any tips? Is it possible in a DIV program to retrieve the value of what's in exec.path?
View user's profile View All Posts By User
CicTec
DIV Pro
******




Posts: 471
Registered: 6-8-2016
Member Is Offline


[*] posted on 4-2-2018 at 04:08 PM


Hi Casper,

GET_DIRINFO is one of the functions I have in the list to be implemented.

It simply does not work for windows because it uses search functions for UNIX and DOS, it is necessary to implement the version with the appropriate WINDOWS functions to work well.

At the moment it will not work any way you try.
View user's profile View All Posts By User
Casper
DIV Pro
******




Posts: 31
Registered: 18-10-2017
Member Is Offline


[*] posted on 4-2-2018 at 08:27 PM


Hey CicTec,

That's interesting... because I do manage to get some information about the files in a directory using get_dirinfo()... perhaps Windows has a fallback for old DOS commands?
View user's profile View All Posts By User
CicTec
DIV Pro
******




Posts: 471
Registered: 6-8-2016
Member Is Offline


[*] posted on 4-2-2018 at 08:55 PM


has some fallbacks probably, but to properly list the files and their names you need the native functions of the Windows API, especially to work properly in the latest versions like Windows 8 and 10.
View user's profile View All Posts By User

  Go To Top

Powered by XMB
XMB Forum Software © 2001-2012 The XMB Group
[Queries: 18]