Echelon i.LON SmartServer Uživatelská příručka Strana 250

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 266
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 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)
Zobrazit stránku 249
1 2 ... 245 246 247 248 249 250 251 252 253 254 255 ... 265 266

Komentáře k této Příručce

Žádné komentáře