Re: [AD] Re: file_select_ex patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Chris wrote:
Then it's a bad program. It should be very cautious of the filesystem flags.

pardon? what is wrong with e.g.

#include <stdio.h>
int main() {
  FILE* f = fopen("guma", "w");
  fprintf(f, "bblblbl");
  fclose(f);
  return 0;
}

I expect that you would write it as something like:
#include <stdio.h>
#if WINDOWS
  #include <windows.h>
#elif UNIX
  #include <something.h>
#else
  #error
#endif
int main() {
  #if WINDOWS
    if (some_func_to_detect_ro_parent_dir_under_win())
      some_func_to_make_the_dir_not_ro_under_win();
  #elif UNIX
    if (some_func_to_detect_ro_parent_dir_under_unix())
      some_func_to_make_the_dir_not_ro_under_unix();
  #endif
  FILE* f = fopen("guma", "w");
  fprintf(f, "bblblbl");
  fclose(f);
  return 0;
}
otherwise you program bad by using your definition....

--
Regards,
    Michal

ICQ# 175762750




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/