Windows All Folder Files Listing

L

LMAX

Guest
Hello !

Please tell me how can I create a list with all files from a specified path and folder (E:\TEST\*.*)

Thank You !
 
As that location would be outside of the sandboxed file system that GMS 1 and 2 uses, you would have to use an extension. There are some available on the marketplace.

If you have an older version of Game maker, I think they can do it without an extension.
 
L

LMAX

Guest
I don't need an extension...
I need my own code to do that...
 

rIKmAN

Member
I don't need an extension...
I need my own code to do that...
Then I suggest you put some effort in and take a look at the manual, then ask any questions you might have once you have at least tried to do it yourself. Both of your threads are begging people to do it for you, that's now how the forum works and not how you learn anything yourself.

Start here:
File System Functions
Sandboxing
 
L

LMAX

Guest
please tell me why this code is not working :
findfile=file_find_first("E:\TEST_FOLDER\*.*", fa_directory);
while (findfile!="")
{
show_message(findfile);
findfile=file_find_next();

}
file_find_close();
 
Last edited by a moderator:
L

LMAX

Guest
Can somebody be more specific?
TEST_FOLDER is an ordinary folder on my Windows "E" drive.
Please just tell me how can I read all the files names from that folder through code or how to set working directory to that folder.
I need to create a list with the files to use it in my game.
Thank You !
 
Z

Zep--

Guest
You need to try your code to use the same folder as where the executable is located (ie: the sandbox). if it works there, you have your answer.
 
H

Homunculus

Guest
Please read what the others are saying, the keyword here is "sandbox". In short: you can not read files or folders on your hard drive other than the game folder game maker creates for you. That's your sandbox. So no, you can't read the files from "E:\TEST_FOLDER\" natively in game maker.

You may be able to do that with an extension from the marketplace.
 
Gee whiz. Your question has been answered and answered and answered. GM runs inside a SANDBOX. What this means is that you do not have access to all the folders on the drive. You ONLY HAVE ACCES TO the %localappdata%\<Game Name> directory. That's it. Ain't no way of getting around it WITHOUT USING AN EXTENSION. Your E:\Test folder is quite obviously not inside the %localappdata%\<Game Name> directory so you DO NOT HAVE ACCESS TO IT. That is, unless you use an extension, which has been mentioned multiple times already. (This is specifically for windows, other platforms will have another specific place in the drive that you have access to, but the exact same scenario applies).
 
L

LMAX

Guest
Now I understand this limitation of GM.
I will try to put my folder where the GM .exe file is located.
Thank You !
 
Top