File hide in C++

This is a discussion on File hide in C++ within the C++ Programming forums, part of the General Programming Boards category; Hi dears i want to write a C++ code to hide a text/doc file. Can anyone help me how i ...

  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,893
    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
    Katy, Texas
    Posts
    2,309
    When you say "hide", do you mean setting the file attribute to hidden?
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  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,059
    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をこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,761
    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,059
    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
    21,885
    Parts of this thread was moved to Operating Systems and Security Against Viruses.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    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, 09:57 AM
  5. Need a suggestion on a school project..
    By Screwz Luse in forum C Programming
    Replies: 5
    Last Post: 11-27-2001, 01:58 AM

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