file protection

This is a discussion on file protection within the C Programming forums, part of the General Programming Boards category; can any one help me how to protect files using C...

  1. #1
    Registered User
    Join Date
    Oct 2009

    file protection

    can any one help me how to protect files using C

  2. #2
    Registered User
    Join Date
    Jan 2009
    Besides changing file permissions using fchmod (assuming UNIX) I don't know how it could be done. Perhaps someone else have an idea.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    I think it depends on what you mean by "protect".
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Sep 2008
    Toronto, Canada
    In Microsoft Visual Studio it's _chmod() and _wchmod()

  5. #5
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Portland, OR
    remove( filename );
    This ensures that nobody can access your file, thus "protecting" it.
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);

  6. #6
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    encrypt it with a random sequence of numbers then delete the sequence, guaranteed noone will access it.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  7. #7
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Open the file, never close it, and hope your have a crappy OS that doesn't allow concurrent file accesses!

    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 02:04 PM
  2. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 10:54 AM
  3. archive format
    By Nor in forum A Brief History of
    Replies: 0
    Last Post: 08-05-2003, 08:01 PM
  4. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 09:19 PM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 02:58 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21