tagged [file-io]

How to copy a file to another path?

How to copy a file to another path? I need to copy a file to another path, leaving the original where it is. I also want to be able to rename the file. Will FileInfo's CopyTo method work?

30 Dec at 12:20

How can I read a single character at a time from a file in Python?

How can I read a single character at a time from a file in Python? In Python, given the name of a file, how can I write a loop that reads one character each time through the loop?

12 Jan at 06:26

How to read a specific line using the specific line number from a file in Java?

How to read a specific line using the specific line number from a file in Java? In Java, is there any method to read a particular line from a file? For example, read line 32 or any other line number.

14 Oct at 07:6

How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office?

How do I create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office? How can I create an Excel spreadsheet with C# without requiring Excel to be installed on the machine that's ru...

7 Oct at 13:30

How do I restore a file from the recycle bin using C#?

How do I restore a file from the recycle bin using C#? Moving files to the recycle bin and emptying the recycle bin are well documented, but how can a file be programmatically restored from the recycl...

20 Feb at 14:55

How to see if a directory exists or not in Perl?

How to see if a directory exists or not in Perl? To see if a file exists before using it, we can use: But how to indentify a directory exists or not?

20 Dec at 04:49

How can I read a large text file line by line using Java?

How can I read a large text file line by line using Java? I need to read a large text file of around 5-6 GB line by line using Java. How can I do this quickly?

How to get File Created Date and Modified Date

How to get File Created Date and Modified Date I have an .NET EXE file . I want to find the file created date and modified date in C# application. Can do it through reflection or with IO stream?

3 Dec at 01:45

Getting the inputstream from a classpath resource (XML file)

Getting the inputstream from a classpath resource (XML file) In Java web application, Suppose if I want to get the InputStream of an XML file, which is placed in the CLASSPATH (i.e. inside the folder)...

27 Apr at 12:6

How can I determine if a file is binary or text in c#?

How can I determine if a file is binary or text in c#? I need to determine in 80% if a file is binary or text, is there any way to do it even quick and dirty/ugly in c#?

1 May at 11:55

How to delete a whole folder and content?

How to delete a whole folder and content? I want the users of my application to be able to delete the DCIM folder (which is located on the SD card and contains subfolders). Is this possible, if so how...

How to read a file from jar in Java?

How to read a file from jar in Java? I want to read an XML file that is located inside one of the `jar`s included in my class path. How can I read any file which is included in the `jar`?

10 Nov at 17:50

Ant: How to execute a command for each file in directory?

Ant: How to execute a command for each file in directory? I want to execute a command from an Ant buildfile, for each file in a directory. I am looking for a platform-independent solution. How do I do...

Save and load MemoryStream to/from a file

Save and load MemoryStream to/from a file I am serializing an structure into a `MemoryStream` and I want to save and load the serialized structure. So, How to Save a `MemoryStream` into a file and als...

21 Dec at 22:45

FileInfo.MoveTo() vs File.Move()

FileInfo.MoveTo() vs File.Move() Is there any difference between these two methods of moving a file?

28 Apr at 21:32

File.Move Does Not Work - File Already Exists

File.Move Does Not Work - File Already Exists I've got a folder: > c:\test I'm trying this code: I get exception: > File already exists The output directory definitely exists and the input file is the...

20 Jun at 11:15

How can I read large text files line by line, without loading them into memory?

How can I read large text files line by line, without loading them into memory? I want to read a large file (>5GB), line by line, without loading its entire contents into memory. I cannot use `readlin...

28 Aug at 20:25

Check line for unprintable characters while reading text file

Check line for unprintable characters while reading text file My program must read text files - line by line. Files in UTF-8. I am not sure that files are correct - can contain unprintable characters....

21 Sep at 16:20

Copy files with widestring path in C++

Copy files with widestring path in C++ I'm having some trouble using wchar_t* strings for copying a file, how do I open them in C/C++ I need to use wide chars because the filenames are in unicode with...

2 Aug at 13:55

Append to a file in Go

Append to a file in Go So I can read from a local file like so: And I can write to a local file But how can I append to a file? Is there a built in method?

5 Mar at 22:30

How do I tell if a file does not exist in Bash?

How do I tell if a file does not exist in Bash? This checks if a file exists: How do I only check if the file does exist?

17 Jul at 00:23

How to get all files under a specific directory in MATLAB?

How to get all files under a specific directory in MATLAB? I need to get all those files under `D:\dic` and loop over them to further process individually. Does MATLAB support this kind of operations?...

Write a circular file in c++

Write a circular file in c++ I need to write a circular file in c++. The program has to write lines in a file and when the code reaches a maximum number of lines, it must overwrite the lines in the be...

23 Sep at 21:38

Read from a file starting at the end, similar to tail

Read from a file starting at the end, similar to tail In native C#, how can I read from the end of a file? This is pertinent because I need to read a log file, and it doesn't make sense to read 10k, ...

6 Dec at 16:52

Open Excel file for reading with VBA without display

Open Excel file for reading with VBA without display I want to search through existing Excel files with a macro, but I don't want to display those files when they're opened by the code. Is there a way...

14 Jan at 08:47