We will discuss about four file hacks listed as below-
- Rename – Rename a file using C/C++
- Remove – Remove a file using C/C++
- File Size – Get the file size using C/C++
- Check existence – Check whether a file exists or not in C/C++
This article is contributed by Rachit Belwariar. If you like GeeksforGeeks and would like to contribute, you can also write an article and mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Bitwise Hacks for Competitive Programming
- Set position with seekg() in C++ language file handling
- tellp() in file handling with c++ with example
- File Handling through C++ Classes
- C program to copy contents of one file to another file
- Find sum of integers in a file which contains any characters
- When should we write our own copy constructor?
- Comma operator should be used carefully
- When should we write our own assignment operator in C++?
- Why copy constructor argument should be const in C++?
- Why we should avoid using std::endl
- Top 5 IDEs for C++ That You Should Try Once
- Comparison of Exception Handling in C++ and Java
- Exception handling and object destruction | Set 1
- Exception Handling in C++
- Socket Programming in C/C++: Handling multiple clients on server without multi threading
- C++ | Signal Handling
- Check if X can give change to every person in the Queue
- fopen() for an existing file in write mode
- Implement your own tail (Read last n lines of a huge file)