I don't want my programs to access the file system at all
means no file creation, no deletion not even the a single stream for accessing files.
how can i do that

Recommended Answers

All 5 Replies

//#include <fstream>

Then don't do that :) Don't put any code in the program that accesses the file system. Simple.

Then don't do that :) Don't put any code in the program that accesses the file system. Simple.

actually i am expecting that code from some one else so i am not sure about that
any ways i can make some changes to the code before compiling.
i use windows xp but i can migrate to ubuntu if u want me to use linux.

>>i use windows xp but i can migrate to ubuntu if u want me to use linux.
why would I care if you use *nix or Windows ?

Since you have the source code then change it to comment out all the file i/o stuff. Start by commenting out #include <fstream> . When you compile you might get a whole bunch of errors. Go through the error messages one at a time and comment out or delete the offending line(s).

That could amount to a huge chore, depending on the program. What are you going to do with the section(s) of the code that depend on the data that is read and/or written to the file system?

Actually, he's talking about preventing someone else's program from accessing the file system.

Check out your answer over at CodeGuru.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.