(C++) FileIo
January 30, 2018 ยท View on GitHub
File I/O is working with files, like saving, reading, copying and searching.
File I/O STL functions and data types
- std::fstream: file stream
- std::remove: remove a file
File I/O code snippets



boost::filesystem::copy_file, copy a file


Check if a file exists, IsRegularFile


Copy a file, boost::filesystem::copy_file


Copy a file, CopyFile


CopyFile, copy a file


DeleteFile, delete a file


Delete a file, DeleteFile


FileToStringList, read a file in a TStringList


FileToVector, read a file in a std::vector


Get a file's path, GetPath


Get all C++ filenames in a folder, GetCppFilesInFolder


Get all filenames in a folder, GetFilesInFolder


Get the extension of a filename, GetExtension


Get the name of the folder your application runs in, GetCurrentFolder


GetCppFilesInFolder, get all C++ filenames in a folder


GetCurrentFolder, get the name of the folder your application runs in


Get the names of the folders in a folder, GetFoldersInFolder


GetExtension, get the extension of a filename


GetFilesInFolder, get all filenames in a folder


GetFoldersInFolder, get all the names of the folders in a folder


GetPath, get a file's path


IsFolder, check if a path is a folder


IsRegularFile, check if a file is a regular file


ReadDoubleFromFile, read a double from file


Read a double from file, ReadDoubleFromFile


Read a file in a std::vector, FileToVector


Read a file in a TStringList, FileToStringList


Remove the extension of a filename, RemoveExtension


RemoveExtension, remove the extension of a filename


Run another program and use its output


Save a container to file, SaveContainer


SaveContainer, save a container to file


SimplifyPath, simplify a path