Bonjour tout le monde, je voudrais savoir quelle méthode pourrait me dire si un fichier existe ou non.
dans la faq, ils disent d'utiliser ça:
mais ça fait boguer mon application puisqu'il essaye d'ouvrir un fichier qui n'existe pas....
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11 CString sPath = currDoc->GetPathName(); FILE *fp = fopen(sPath,"r"); if (fp == NULL) { //fichier inexistant } else { fichier existant fclose(fp); }
savez vous comment je pourrais faire?
Partager