C File File Operation

C examples for File:File Operation

Description

Click the following links for the tutorial for File and File Operation.

  1. Viewing the contents of a file
  2. File Open Modes Summary
  3. File Pointer and open file function
  4. Using fopen( ), getc( ), putc( ), and fclose( ) to read char from console and write back to a file
  5. Rewind( ) function resets the file position indicator to the beginning of the file
  6. The remove( ) function deletes the specified file.
  7. Fseek() seeks to and displays the specified byte in the specified file.
  8. Uses freopen( ) to redirect stdout to a file called OUTPUT:


  9. Fread( ) and fwrite( ) can read and write any type of information.
  10. Ferror( ) function determines whether a file operation has produced an error.
  11. Opening and Closing Files
  12. Appending Data to a file
  13. Opens a file and prints A through Z into the file
  14. Opens existing file and adds a line to the end
  15. Reads each line from the file and outputs it to the screen
  16. Delete a File


  17. Rename a File
  18. Copy a Binary File
  19. Copy a Text File
  20. Write to a File and Then Read from That File
  21. Copying a file.
  22. Demonstration of temporary filenames.
  23. Using rename() to change a filename.
  24. Demonstrates the remove() function.
  25. Uses fprintf(), fscanf(), and rewind()
  26. Mode Strings for fopen()
  27. Copy program that prompts the user to enter the name of a text file to act as the source file and the name of an output file
  28. Copy file character by character
  29. Reduces your files by two-thirds
  30. Read source file and target file name and copy the file
  31. Compare Files
  32. Read number with fread() function, check the file end of feof() function
  33. Count distinct numbers in a file
  34. Sift Up a heap