Advertisement
Guest User

Untitled

a guest
Dec 15th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. void debugWrite(int lvl, char buff[])
  2. {
  3. if(debugLVL <= lvl)
  4. {
  5. FILE *fp;
  6.  
  7. fp=fopen("/home/local/FERMI/s01093/Documenti/tpsit/debugLibrary/test.txt", "w"); //opens test.txt in the directory specified
  8.  
  9. if(fp == NULL) //if file does not exist, create it
  10. {
  11. fp = fopen("test.txt", "wb");
  12. }
  13.  
  14. fprintf(fp, "%s", buff); //writes in file test.txt
  15. fclose(fp);
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement