CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    May 2008
    Posts
    11

    How to stop a program from accessing the file system

    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

  2. #2
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: How to stop a program from accessing the file system

    It seems you are going to prepare FAQS on "How to restrict a program...."
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  3. #3
    Join Date
    May 2008
    Posts
    96

    Re: How to stop a program from accessing the file system

    In interpreted language environments, you often have the option to create a "sandbox" interpreter. However, the actual process still has the same permissions and accesses as any other executable process.

    For compiled programs like C++, you have to create that sandbox using features of the OS --which, obviously, is entirely platform-dependent.

    On windows, you can control group policy permissions and program access rights.

    Good luck.

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: How to stop a program from accessing the file system

    Err.... Don't write any code that access file?

  5. #5
    Join Date
    May 2008
    Posts
    11

    Re: How to stop a program from accessing the file system

    heheh
    no actually i have to check some code in y college
    for that i need help
    thanks 2 u all 4r helping me

  6. #6
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: How to stop a program from accessing the file system

    Unique education system! We learnt "how to" and your college asks you to learn "How to prevent".
    Pretty advanced!
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  7. #7
    Join Date
    May 2008
    Posts
    11

    Re: How to stop a program from accessing the file system

    no they dont want it
    i wan it to do that so that it will become easy and even i can learn some thing

  8. #8
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: How to stop a program from accessing the file system

    But that's not proper way of learning. First learn (if you dont know) how-to do something, then advanced concepts with that, followed by some real world developement.

    At codeguru, we offer solutions to some problems (homework assisgments are generally ignored); and not this how NOT to !
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  9. #9
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: How to stop a program from accessing the file system

    Run it on a different machine. Then it'll never be able to touch your filesystem.

    Seriously, what possible use would such a restriction be?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured