Echelon i.LON SmartServer 2.0 Instrukcja Użytkownika Strona 250

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 266
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 249
236 Appendix A - Programmer’s Reference
if((pFile = fopen(Filename,"a")) == NULL)
{
printf(“Can't open or create i.LON 100 file = %s \n",
Filename);
}
else
{
fwrite(buf,1,len,pFile);
fclose(pFile);
printf("Wrote %d bytes to file = %s \n", len, Filename);
}
fclose()
You can use the fclose()method to close a file.
SYNTAX
int fclose (FILE * stream);
The stream parameter specifies a pointer to a FILE object
that specifies the file stream to be
closed.
If the file has been closed successfully, this method returns a zero value. Otherwise, it returns
EOF (End-of-File).
EXAMPLE
The following example demonstrates an fclose()method that closes a file stream.
FILE * pFile;
fclose (pFile)
Przeglądanie stron 249
1 2 ... 245 246 247 248 249 250 251 252 253 254 255 ... 265 266

Komentarze do niniejszej Instrukcji

Brak uwag