[C++] Modifier c:\boot.ini

Modifier c:\boot.ini [C++] - Programmation

Marsh Posté le 07-04-2002 à 18:41:39    

bonjour, le code suivant ne produit rien (ni erreur, ni effet !) :
 
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
 
void main()
{
FileSetAttr("c:\boot.ini", faArchive);
char msg[] = "[boot loader]\n";
 
int fich = open("c:\boot.ini", O_RDWR | O_TEXT);
lseek(fich, 0L, SEEK_SET);
 
for (int i=0; i<3; i++)
 write(fich, msg, strlen(msg));
 
close(fich);
}
 
sur certains fichiers qui sont sur d: ça marche, et même pas tjrs !!!
 
j'y ai passé près de 2 heures !!! help me plz !!! :hello:


---------------
Visitez mon site : http://www.jujubarbare.linux-fan.com
Reply

Marsh Posté le 07-04-2002 à 18:41:39   

Reply

Marsh Posté le 07-04-2002 à 19:26:06    

:cry:


---------------
Visitez mon site : http://www.jujubarbare.linux-fan.com
Reply

Marsh Posté le 07-04-2002 à 21:41:43    

Faudrait vraiment que tu te mettes à la gestion d'erreur...
 
Sur chaque fonction, F1 et tu regardes la valeur de retour.
 
 :ange:


---------------
Vendredi c'est Buitoni
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed