Top "File-handling" questions

file-handling is an abstraction of common actions such as creating, opening, closing, reading, updating, writing, comparing and deleting files

How to move a file?

I looked into the Python os interface, but was unable to locate a method to move a file. How would …

python file file-handling
How to read line by line or a whole text file at once?

I'm in a tutorial which introduces files (how to read and write from\to file) First of all, this is …

c++ iostream fstream file-handling
How to check if a file is empty in Bash?

I have a file called diff.txt. I Want to check whether it is empty. I wrote a bash script …

linux bash unix file-handling is-empty
How to Find And Replace Text In A File With C#

My code so far StreamReader reading = File.OpenText("test.txt"); string str; while ((str = reading.ReadLine())!=null) { if (str.Contains("…

c# .net io streamreader file-handling
How can I download a file from a URL and save it in Rails?

I have a URL to an image which i want to save locally, so that I can use Paperclip to …

ruby-on-rails ruby file-handling
How do I clear the whole contents of a file in C?

I have a file with some of user1's data. I want to use the same file for user2 by …

c file file-io file-handling
Php create a file if not exists

I try to create files and write the contents dynamically. Below is my code. $sites = realpath(dirname(__FILE__)).'/'; $…

php file-handling
Write text files without Byte Order Mark (BOM)?

I am trying to create a text file using VB.Net with UTF8 encoding, without BOM. Can anybody help me, …

vb.net encoding file-handling byte-order-mark
Write to a file in Perl

Consider: #!/usr/local/bin/perl $files = "C:\\Users\\A\\workspace\\CCoverage\\backup.txt"; unlink ($files); open (OUTFILE, '>>$…

perl file-handling
Exception Handling and Opening a File?

Is it possible to use exceptions with file opening as an alternative to using .is_open()? For example: ifstream input; …

c++ exception-handling inputstream file-handling