Top "File" questions

A block of arbitrary information, or resource for storing information, accessible by the string-based name or path.

Standard concise way to copy a file in Java?

It has always bothered me that the only way to copy a file in Java involves opening streams, declaring a …

java file copy
How do I append text to a file?

What is the easiest way to append text to a file in Linux? I had a look at this question, …

linux file text file-io append
How to read a file in Groovy into a string?

I need to read a file from the file system and load the entire contents into a string in a …

file groovy
How to check if a file exists in Go?

Go's standard library does not have a function solely intended to check if a file exists or not (like Python's …

file go standard-library
How to extract filename.tar.gz file

I want to extract an archive named filename.tar.gz. Using tar -xzvf filename.tar.gz doesn't extract the file. …

linux file gzip tar
In Java, how do I parse XML as a String instead of a file?

I have the following code: DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(xmlFile); How can I get it to parse XML contained within …

java xml string file parsing
Find a line in a file and remove it

I'm looking for a small code snippet that will find a line in file and remove that line (not content …

java file editing
How to find files that match a wildcard string in Java?

This should be really simple. If I have a String like this: ../Test?/sample*.txt then what is a generally-accepted …

java file wildcard
Reading numbers from a text file into an array in C

I'm a programming noob so please bear with me. I'm trying to read numbers from a text file into an …

c arrays file scanf