Thread: File hide in C++

  1. #1
    Registered User
    Join Date
    Jun 2007
    Location
    Qatar
    Posts
    39

    Cool File hide in C++

    Hi dears
    i want to write a C++ code to hide a text/doc file. Can anyone help me how i should proceed

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Hide?

    Why?
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User bradszy's Avatar
    Join Date
    Jan 2008
    Posts
    114
    Maybe it's dirty. Just kidding.

  4. #4
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    When you say "hide", do you mean setting the file attribute to hidden?
    Mainframe assembler programmer by trade. C coder when I can.

  5. #5
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    Are you talking about encryption? If so then that is easy. Or you could archive it until you need it again.

  6. #6
    Registered User
    Join Date
    Jun 2007
    Location
    Qatar
    Posts
    39

    Cool

    Definitly to "hide", i mean to set its attributes hidden and not encryption.So that i can archive at anyother time.

  7. #7
    The larch
    Join Date
    May 2006
    Posts
    3,573
    On Windows you might need SetFileAttributes.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  8. #8
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    Quote Originally Posted by anon View Post
    On Windows you might need SetFileAttributes.
    Unfortunately, that can easily be circumvented thru windows explorer by choosing the Tools option from the menu, next Folder options and then select the View tab and finally enable "show hidden files and folders". Windows explorer will now show all hidden files and folders.

    Another way would be to intercept the O/S I/O requests on any file(s) and/or folder(s) to be hidden. Thus, bypassing the item to be hidden.

  9. #9
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    If it's an NTFS file system, you can Deny all access to the file to everyone except a certain user. I'm not sure what the WIN32 API calls are to do that, but just right-click on the file and go to Properties, click on the Secutiry tab...

  10. #10
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Doing it the API way is more trouble than it's worth.
    Damn Microsoft can't implement anything without a lot of complexities.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  11. #11
    Registered User
    Join Date
    Mar 2005
    Location
    Mountaintop, Pa
    Posts
    1,058
    Quote Originally Posted by cpjust View Post
    If it's an NTFS file system, you can Deny all access to the file to everyone except a certain user. I'm not sure what the WIN32 API calls are to do that, but just right-click on the file and go to Properties, click on the Secutiry tab...
    SetFileSecurity

  12. #12
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Parts of this thread was moved to Operating Systems and Security Against Viruses.
    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

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Encryption program
    By zeiffelz in forum C Programming
    Replies: 1
    Last Post: 06-15-2005, 03:39 AM
  2. archive format
    By Nor in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-05-2003, 07:01 PM
  3. Making a LIB file from a DEF file for a DLL
    By JMPACS in forum C++ Programming
    Replies: 0
    Last Post: 08-02-2003, 08:19 PM
  4. Hmm....help me take a look at this: File Encryptor
    By heljy in forum C Programming
    Replies: 3
    Last Post: 03-23-2002, 10:57 AM
  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