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
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
So, don't create, open, or delete files?
Go away.
If you can't tell us which OS you're using, we're going to get fed up "real soon now" of even caring whether you get an answer or not.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
I find it quite unlikely that you would be able to start an application without accessing the filesystem on either of Linux or Windows.
You can of course have a read-only filesystem [available in both] that would essentially prevent any CHANGES to the filesystem.
If you explain what your ultimate goal is (I suspect that you are trying to set up an internet cafe/student computer room or similar and want to prevent users from corrupting the machines), we may be able to suggest better solutions.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
the scenario is that i have to some programs on my system.
the programs are quite simple, hardly 4-5 classes, i have to test it on my system but i dont want to mess up my system up because i dont know the code provided and c++ is really powerful .. other then these class files i wont the program to touch any other filse
So, make your filesystem read only. You can do that trivially by setting up a different user that has no access to write to any directory on the machine.
But a quick code-review should expose any trivial attempts to do harmful things to your system. If the attempts are really complex, then you probably want to run this in a virtual machine that doesn't have access to the hardware at all, such as Xen or VMWare's solutions. Both are free.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.