Top "File-io" questions

File I/O is input/output that involves the file system.

How to find and restore a deleted file in a Git repository

Say I'm in a Git repository. I delete a file and commit that change. I continue working and make some …

git file-io git-checkout
How to delete files/subfolders in a specific directory at the command prompt in Windows

Say, there is a variable called %pathtofolder%, as it makes it clear it is a full path of a folder. …

windows batch-file file-io cmd directory
open() in Python does not create a file if it doesn't exist

What is the best way to open a file as read/write if it exists, or if it does not, …

python linux file-io file-permissions
Reading binary file and looping over each byte

In Python, how do I read in a binary file and loop over each byte of that file?

python file-io binary
C read file line by line

I wrote this function to read a line from a file: const char *readLine(FILE *file) { if (file == NULL) { printf("…

c file-io line libc
UnicodeDecodeError: 'charmap' codec can't decode byte X in position Y: character maps to <undefined>

I'm trying to get a Python 3 program to do some manipulations with a text file filled with information. However, when …

windows python-3.x unicode file-io decode
How to redirect output to a file and stdout

In bash, calling foo would display any output from that command on the stdout. Calling foo > output would redirect …

linux bash file-io io stdout
Reading a .txt file using Scanner class in Java

I am working on a Java program that reads a text file line-by-line, each with a number, takes each number …

java file-io java.util.scanner
How to write to file in Ruby?

I need to read the data out of database and then save it in a text file. How can I …

ruby file-io
Rename multiple files in a directory in Python

I'm trying to rename some files in a directory using Python. Say I have a file called CHEESE_CHEESE_TYPE.*** …

python file-io file-rename