There is no such function in the standard C library.
Open the file for reading
Open an output file for writing.
Read the first file, line at a time. If it's not the line you want to delete, write the line to the output file.
Close both files.
Change the name of the first file to something else.
Change the name of the second file to the original name of the first file.
Then and ONLY then is it safe to delete the original file.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment