![]() |
|
Location of Saved Files |
inspiredevistate
Member #7,980
November 2006
|
A quick question... I am trying to control where the user saves a file. For example, the user creates a bitmap and wants to save this bitmap. I want the bitmap to be saved under the folder the program is run from under a folder called "Bitmaps" Currently, I am only using save_bitmap(); I am thinking file_select_ex() may be what I need? But is there another way? |
TeamTerradactyl
Member #7,733
September 2006
![]() |
Usually, if you do not provide a path option for them, such as file_select_ex, then the user is forced to accept your path selections. 1) Prompt them for the "save to:" filename (not path)
|
Matthew Dalrymple
Member #7,922
October 2006
![]() |
char* Savefilename; Savefilename = "Bitmaps/hethisismyfirstbitmap.bmp"; save_bitmap(Savefilename, ...) Just include the relative path in the filename section in save_bitmap(), that will store it in any directory you want. =-----===-----===-----= |
inspiredevistate
Member #7,980
November 2006
|
Quote:
char* Savefilename; for some reason, it didn't create the BITMAP folder, I searched for it and could not find it... this is what i used char *path; /*allegro has been init and all that good stuff and user picks Yes to save file*/ path = "Bitmaps\\testbmp.bmp"; save_bitmap(path, myBMP, pal); /*exiting allegro, etc*/
|
LennyLen
Member #5,313
December 2004
![]() |
Quote: for some reason, it didn't create the BITMAP folder You will have to do this yourself. If you're using gcc, there is the mkdir() function for creating directories.
|
inspiredevistate
Member #7,980
November 2006
|
Thanks! I've finally figured it out! Thanks to all your help!!;D |
TeamTerradactyl
Member #7,733
September 2006
![]() |
You may also want to use '/' instead of '\\' for path separators: Windows will automatically convert these to the double-backslashes for you, and this makes it more cross-compatible with Linux/Mac.
|
|