Java is not my main programming language so I might be asking the obvious.
But is there a simple file-handling library in Java, like in python?
For example I just want to say:
File f = Open('file.txt', 'w')
for(String line:f){
//do something with the line from file
}
Thanks!
UPDATE: Well, the stackoverflow auto-accepted a wei...
#define __T(x) L ## x
Found in code from one of the MFC source header file. It is mostly used for converting strings to ........ (I don't know what). If I am correct it converts strings to LPCTSTR...don't know what that type is either...
I can't seem to convert char* into LPCTSTR. While MFC file handling, the following code will ...
Given a url pointing to a file hosted on the webserver, is it possible to read the contents of that url into a clob? And if so, how?
...
Hi,
I'm writing an application that will ship in two versions: Android and PC version.
Is there a simple way to access files from the shared code?
Using java.io is simple, but I don't know how to access android resources or assets using it. And I can't write methods that operate on FileInputStreams instead, because some files contain r...
i think i can use "Scanner" to read a .txt file but how can i write or even create a new text file?
...
Hello,
i need to call sqlcmd from stored procedure to export table to text file?
...
I am using Apache Tomcat Server 6 and Java 1.6 and am trying to write large mp3 files to the ServletOutputStream for a user to download. Files are ranging from a 50-750MB at the moment.
The smaller files aren't causing too much of a problem but with the larger files it and getting socket exception broken pipe.
File fileMp3 = new File(o...
I have an image which is in the form of a ByteArrayInputStream. I want to take this and make it something that I can save to a location in my filesystem.
I've been going around in circles, could you please help me out.
...
Does the IO.File.Copy method preserve file attributes? Especially, if I have a write-protected file, will the copy be write-protected to?
...
Is there any way you can overwrite a line in PHP. let me be a little more clearer using examples.
My array
array{
[DEVICE] => eth0,
[IPADDR] => 192.168.0.2,
[NETMASK] => 255.255.255.0,
[NETWORK] => 192.168.0.0,
[BROADCAST] => 255.255.255.255,
[GATEWAY] => 192.168.0.1,
[ONBOOT] => no
}
File im overwriting
...
If I have a text file like:
123, joe blow, USA
Where the first values represent:
USERID, NAME, COUNTRY
If my file has 5000 rows, could I update a particular row somehow using C#?
...
Sometimes in reading data involving many names and figures
reading line by line needs some serious concatenation work ,
is there any method that would allow me to read a specific data type? like the good old fscanf in C?
Thanks
Sara
...
I'd like to use the 'include' keyword in php to randomly select a file from a folder and output the contents. How would I do this?
Thanks.
...
Hi,
I'm working on a system that requires high file I/O performance (with C#).
Basically, I'm filling up large files (~100MB) from the start of the file until the end of the file.
Every ~5 seconds I'm adding ~5MB to the file (sequentially from the start of the file), on every bulk I'm flushing the stream.
Every few minutes I need to upda...
Hello!
I'm writing an application that will have to be able to handle many concurrent accesses to it, either by threads as by processes. So no mutex'es or locks should be applied to this.
To make the use of locks go down to a minimum, I'm designing for the file to be "append-only", so all data is first appended to disk, and then the ad...
Hi,
I read a file into a string, change the first line and then write this string into a new file. I do this through the following code (a little bit shortened):
while(jspIterator.hasNext()){
String line = (String) jspIterator.next();
if (i == 0) {
if (line.startsWith("bla...
In Android's settings, in the "Manage Applications" activity when clicking on an app, the data is broken down into Application, Data, and cache. There is also a button to clear the cache. My app caches audio files and I would like the user to be able to clear the cache using this button. How do I store them so they get lumped in with ...
hi there,
I need to read a text file when I start my program. I'm using eclipse and started a new java project. In my project folder I got the "src" folder and the standard "JRE System Library" + staedteliste.txt... I just don't know where to put the text file. I literally tried every folder I could think off....I cannot use a "hard cod...
Hi all,
I have this recurrent Java JAR program tasks that tries to modify a file every 60seconds.
Problem is that if user is viewing the file than Java program will not be able to modify the file. I get the typical IOException.
Anyone knows if there is a way in Java to modify a file currently in use? Or anyone knows what would be the...
Hello,
We have to learn VB.NET for the semester, my experience lies mainly with C# - not that this should make a difference to this particular problem.
I've used just about the most simple way to save a file using the .NET framework, but Windows 7 won't let me save the file anywhere (or anywhere that I have found yet). Here is the code...