954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

A real locking folder

Hello.. it's me, again :mrgreen:
sorry but I really need code for locking folder
not a code for changing the attribut. :(
'cause i want to put my precious file in that folder :(
so my friend can't steal it :evil: .

Everybody in the world who can/want to help me please send your little
knowledge to this newbies

gluber
Newbie Poster
2 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
 

More or less on every operating system you have to cope with folder's attributes to enforce some way of protection to it's contents. One way is being the root of the system and provide the necessary changes to directory's attributes and making it unaccessible for any other user or simply hiding it. Since this forum especially is for coding (C/C++) my personal advice is to go to the right forum first or (the better option) - consider a lot of coding and reading. In the end you'll be able to protect yourself from some considerable number (at least) of actual or only virtual ;) enemies.

freemind
Junior Poster in Training
62 posts since Jun 2005
Reputation Points: 10
Solved Threads: 1
 

>sorry but I really need code for locking folder
If I recall correctly, you never specified what you think "locking a folder" means. So, instead of starting a new thread with the same stupid question, why not try asking a better question, as I suggested in your last thread?

>not a code for changing the attribut.
Okay, okay, here's the super secret code for "locking" a folder so that nobody can get to the file:

#include <windows.h>

int main()
{
  RemoveDirectory ( "my_super_secret_folder" );
}

Please don't post about this question again until you're smart enough to realize that permissions and attributes are the only way to "lock" a file (as you're using the term) aside from deleting it.

>so my friend can't steal it
Encrypt the file, put it on a thumb drive and keep chained to your pocket if you're so worried about it.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You