Original Post
Say if you have 2 programs that have the same procedure:
And they both use it at the same time...would the program get a "File Access Denied" error? Since both programs are using the files at the same time...
If it would get an error, how can I get around it?
...advice from the insane
class FileManip {
public:
FileManip(); //constructor
~FileManip(); //Destructor
void WriteFile( Char * ); //Writes data to a file
void ReadFile(); // Reads data from a file
private:
Char FilePath[225];
Char DataBuffer[100];
};
FileManip::FileManip();
{
FilePath[] = "c:\Default.dat";
DataBuffer[] = "Empty";
}
~FileManip::FileManip()
{
}
void FileManip::WriteFile( Char Data[] )
{
ofstream FP(FilePath);
FP << Data;
FP.Close();
}
void FileManip::ReadFile()
{
char Data[];
ifstream FP(FilePath);
FP >> Data;
FP.CLose();
}
|