file-handling

How a class that wraps and provides access to a single file should be designed?

MyClass is all about providing access to a single file. It must CheckHeader(), ReadSomeData(), UpdateHeader(WithInfo), etc. But since the file that this class represents is very complex, it requires special design considerations. That file contains a potentially huge folder-like tree structure with various node types and is block/c...

common place to store files on mac and windows.

hi. am writing a java code that needs to save a file. the below code is for mac. ImageIO.write(movie_image, "jpg",new File("/Users/sathyap/Desktop/movieimages/"+fileName+".jpg")); is there a way i can give the directory structure "/Users/sathyap/Desktop/movieimages/" hardcoded that works for both mac and windows. ...

on a Web Setup, how do I exclude all .pdb files?

In a sample solution on Visual Studio 2008, let's say, I have this: myWebSite project (web site project) myLibrary project (library project) myWebsiteDeploy project (web deployment project) myWebSetup project (web setup project) inside myWebSite there is a myLibrary.dll and myLibrary.pdb witch they are included in the myWebSiteDeploy...

slow File Processing in python

Hello All, I am trying a file operation using python.Aim is to continuously read a file of size(100bytes),pack and send them through socket. These files are read from a directory. Problem: when i run the program continuously, execution time is increasing. Initially, execution time is less than a second; later it reaches till 8~10second...

flush() java file handling

What is the exact use of flush()? What is the difference between stream and buffer? Why do we need buffer? ...

File handling java

While trying to do some operation with files the code goes like this, File file=new File("aaa.txt"); I saw in a program BufferedReader and InputStreamReader were also included can you explain this with a simple example? I read in many sites about file handling but still its confusing!!!! ...

C++ Program crashes when reading object from random access file

Hi, I have the following User.h that holds several attributes (strings). User.cpp has all the definitions. //User.h #ifndef USER_H #define USER_H #include<iostream> #include <cstring> using namespace std; class User{ string username; public: User(); string getUsername() const; vo...