Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating/opening/saving to folders.
#1
I need a way to create folders, save to folders, and open files from folders in a FB program. I'm coding a game creator(side-scroller creator, to be exact), and I plan on having the editor create a folder for each user-created game. Inside the folders, each individual level file would be stored. To do this, I must be able to create and manage folders.

Related question: Once I get around my first problem I'll need a way for the program to get the name for each and every folder in the directory.

Thanks in advance. Smile
nd remember kids, only you can provoke forest fires!
Reply
#2
MKDIR
RMDIR

And use relative paths:
gamefolder\folder\level1.level


To get all folders in a dir you have to use some sort of list function, FB has DIR(), but i dont know if you can make it return folders only.

Theres also the SHELL way of doing it..
Reply
#3
Thanks a lot. Do you know of anywhere I can go to research the SHELL way of doing it?
nd remember kids, only you can provoke forest fires!
Reply
#4
SHELL "DIR"

Look up the DIR switches, such as: /OGN /-P /B etc..
To get a list of swiches: DIR /?

safest way is to disable any switch you dont use by putting a - infront of it, like: DIR /-P *.*


To dump console info to a file:
SHELL "DIR *.* > mylist.txt"

It will create/overwrite mylist.txt and dump the console info to it.

To append to the end of a file, do: >> instead of >
Reply
#5
Perhaps DIR$ should have a new optional parameter, an attribute mask...
Antoni
Reply
#6
I used MKDIR "test" and it created a folder named "test" on my Desktop. :-|
nd remember kids, only you can provoke forest fires!
Reply
#7
the exe was on ur desktop, right o.o
Reply
#8
Eh... nevermind, problem solved. When I compiled and ran the program from FBIDE it put the folder on the desktop. When I opened the executable myself it put the folder in the directory of the .exe. So, I got the whole folder business fixed now.
nd remember kids, only you can provoke forest fires!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)