Any idea?

This is a discussion on Any idea? within the C Programming forums, part of the General Programming Boards category; I want to write a program that is to enter a password when trying to enter certain folder . Any ...

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    130

    Any idea?

    I want to write a program that is to enter a password when trying to enter certain folder. Any idea?

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,066
    Access a folder through what? Your program or through the OS shell? Through your program, it's simple. When you take the path name, check to see whether they need special access to that folder and then prompt them to enter the password. If you mean through the shell like Windows Explorer, then only the shell can decide whether to prompt for a password on access.

    If you're just looking to block people from your files, create another profile on your OS and set up a password for that or compress your files into a .ZIP with a password.
    Sent from my iPadŽ

  3. #3
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    Under Linux, remove execute access for the directory.
    Code:
    $ chmod -x directory
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #4
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    Won't that still allow them to list/see what files are in there?
    I've always been a bit puzzled as to why windows (or any other GUI OS) doesn't seem to have competent folder passwording.... you can encrypt a large portion of space through making profiles... but what if you just want to encrypt/password a select few folders within a profile (i.e. prompt before entry)?? zipping/unzipping could take hours if they're large in size and making a new profile for each tier of security is tedious and redundant...

  5. #5
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,162
    IF you walk away from your computer, lock it (WindowsKey + L). Don't let other people know your user's password. Only allow yourself (your user account) access to those folders (using NTFS security permissions).

    For someone else to access the folders, make them run a special program owned by your user that asks for a password before granting them access.
    Last edited by itsme86; 07-03-2006 at 06:57 PM.
    If you understand what you're doing, you're not learning anything.

  6. #6
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    I'm sure we've all been in the situation where a friend occasionally comes over to visit and uses your computer. All your media/games/software is on your account so naturally thats the one you want allow him/her to use. Now lets say there is just one or two folders that are private that you do not want even your friend to see. It would make no sense to make him/her their own seperate account since a) it would just be an exact duplicate of yours, minus those two folders, b) you would have to update both accounts everytime a change was made to one, and c) he/she is not over enough times to warrant all of that fuss.
    It would be nice if there were someway that you could allow your friend to enjoy all your media/software/games on your account while still having those one or two folders off-limits until the correct password is entered. This way anyone on your account can access what you want them to, but only you (the password knower) can respond accurately to a real-time password prompted folder. And the sad thing is, without completely revamping/tinkering/recreating the OS itself, any C/C++ internal browser used to block a folder can simply be bypassed by going through the native OS browser.

  7. #7
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,627
    > there is just one or two folders that are private that you do not want even your friend to see.
    Sounds like a job for! REMOVABLE STORAGE MAN

  8. #8
    Awesomefaceradcore bivhitscar's Avatar
    Join Date
    Apr 2006
    Location
    Melbourne, Australia
    Posts
    210
    I'd suggest reducing your porn intake.
    it's ironic considerate rarity patron of love higher knowledge engulfs me...

  9. #9
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,162
    Use the All Users -> My Documents folder for the shared stuff?
    If you understand what you're doing, you're not learning anything.

  10. #10
    Registered User
    Join Date
    Mar 2006
    Posts
    725
    TrueCrypt it and mount when necessary.
    Code:
    #include <stdio.h>
    
    void J(char*a){int f,i=0,c='1';for(;a[i]!='0';++i)if(i==81){
    puts(a);return;}for(;c<='9';++c){for(f=0;f<9;++f)if(a[i-i%27+i%9
    /3*3+f/3*9+f%3]==c||a[i%9+f*9]==c||a[i-i%9+f]==c)goto e;a[i]=c;J(a);a[i]
    ='0';e:;}}int main(int c,char**v){int t=0;if(c>1){for(;v[1][
    t];++t);if(t==81){J(v[1]);return 0;}}puts("sudoku [0-9]{81}");return 1;}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. project idea ???
    By gemini_shooter in forum C Programming
    Replies: 2
    Last Post: 06-09-2005, 09:56 AM
  2. Have an idea?
    By B0bDole in forum Projects and Job Recruitment
    Replies: 46
    Last Post: 01-13-2005, 02:25 PM
  3. A little problem about an idea, help please
    By louis_mine in forum C++ Programming
    Replies: 3
    Last Post: 09-10-2004, 09:52 PM
  4. totally screwed up idea
    By iain in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 08-17-2001, 12:09 PM

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