Creating directory in A5 for Linux and Windows
PeKaGM

Hi. I'm creating program in which I use funkction "mkdir" for creating directories. In Linux it must look like - mkdir(name_of_dir,0777) - and for Windows just
- mkdir(name_of_dir). How ca I made one source code that will compile in both systems with mkdir ? Now I have to change mkdir syntax when I want to compile for Win or Linux and therefore have two source codes. Or is other way to create directory which will be the same for both systems? Thanks for answers.

Thomas Fjellstrom

you could try al_make_directory. If you must use mkdir, you can use ifdef's to pick which mkdir to use.

Gideon Weems

Don't forget al_get_standard_path. For good examples of its usage, see "framework.c" from the skater demo and Todd Cope's 2014 SpeedHack entry.

Edit: Why no link?

pkrcel

I guess the autolink works only in <code> tags?

Thomas Fjellstrom

Some functions may not be in matthew's api database? My best guess.

Edgar Reynaldo
pkrcel

al_get_standard_path vs. al_get_standard_path

just as I say two posts above

Thomas Fjellstrom

Well, yeah. it doens't work in pre tags. the auto linking is part of the syntax highlighting. Also try `this type of code tag`

Gideon Weems

Thanks, guys. I was thinking that code tags like al_get_standard_path refused to be inline for some reason.

Thread #615073. Printed from Allegro.cc