Skip to content
Tuesday, December 1, 2026Ideas worth exploring. Knowledge worth sharing.
S. SenseCentralDISCOVER EVERY DAY
Programming & Data Structures

What are File Manipulation Functions in C Language

Question: What are File Manipulation Functions in C Language

Answer: Functions which manipulate files without performing I/O with them are called file manipulation functions. They are prototyped below

    int remove(char const *filename);

    int rename(char const *oldname, char const *newname);

‘remove()’ function can be used to explicitly close/delete a file specified by argument. If the specified file is open while remove() was called, behaviour is implementation defined. ‘rename()’ function can be called to change the name of a file from oldname to newname. If the file with newname is already existing while ‘rename()’ was called, behaviour is implementation defined. Both the functions return ZERO when succeed and non-zero value when they fail. If ‘rename()’ fails, file with original name is yet accessible.

For example, for an existing file “hello.txt”,

    remove(“hello.txt”);

    rename(“hello.txt”, “byebye.txt”);

Author

  • A senior editor for The Mars that left the company to join the team of SenseCentral as a news editor and content creator. An artist by nature who enjoys video games, guitars, action figures, cooking, painting, drawing and good music.

WRITTEN BY

Taylor Emma

A senior editor for The Mars that left the company to join the team of SenseCentral as a news editor and content creator. An artist by nature who enjoys video games, guitars, action figures, cooking, painting, drawing and good music.

More from this author ↗

Leave a Reply

Your email address will not be published. Required fields are marked *