Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 11-03-2004, 01:01 AM   #1 (permalink)
john_tran
Registered User
 
Join Date: Oct 2004
Posts: 22
john_tran is on a distinguished road
Question How to hide a file (any file)?

I want to write a program that will hide a file so that noone can see it in the directory. And will unhide it when requesting. What technology i should know to do that?
john_tran is offline   Reply With Quote
Old 11-03-2004, 02:58 AM   #2 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,709
redhead is on a distinguished road
This is a system dependant thing, it is handled within the filesystem, and usualy you would use functions like fstat(), lstat(), stat() and chmod().
These however are not ansi C/C++ compliant.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 11-03-2004, 06:50 PM   #3 (permalink)
Androto
Mac Os X User(I hate win)
 
Join Date: Oct 2004
Posts: 138
Androto is on a distinguished road
i'm not sure if you can rename files in c++ or not, but if you can, rename a file to have a period in the front of the name, it will be considered a hidden file by the os. i know that this works on macs

Last edited by Androto; 11-04-2004 at 07:30 PM.
Androto is offline   Reply With Quote
Old 11-04-2004, 03:17 AM   #4 (permalink)
gamehead200
Code Monkey
 
gamehead200's Avatar
 
Join Date: Oct 2004
Posts: 57
gamehead200 is an unknown quantity at this point
Only in non-MS operating systems will that work, Androto... You can see all files in Windows unless they have been hidden in their file properties...
gamehead200 is offline   Reply With Quote
Old 11-04-2004, 05:27 AM   #5 (permalink)
john_tran
Registered User
 
Join Date: Oct 2004
Posts: 22
john_tran is on a distinguished road
Yes, that's right.
User can unhide easily by choosing Folder Option (windows)/ and set view unhide file.
I mean that the file will hide all time even user set view unhide file. And just my program can set unhide attribute to the file only.

So where node i stay to learn?
john_tran is offline   Reply With Quote
Old 11-04-2004, 07:29 PM   #6 (permalink)
Androto
Mac Os X User(I hate win)
 
Join Date: Oct 2004
Posts: 138
Androto is on a distinguished road
Quote:
Originally Posted by Androto
i'm not sure if you can rename files in c++ or not, but if you can, rename a file to have a period in the front of the name, it will be considered a hidden file by the os. i know that this works on macs
what don't you understand by this?! why would i post that up here if i knew it wouldn't work, anyways, why does windows not use this? is soo much easier to hide files.
Androto is offline   Reply With Quote
Old 11-04-2004, 10:15 PM   #7 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,709
redhead is on a distinguished road
Quote:
Originally Posted by john_tran
I mean that the file will hide all time even user set view unhide file. And just my program can set unhide attribute to the file only.
So where node i stay to learn?
Start writing your own filesystem, where the OS itself can be kept from viewing a file with a specific show/hide bit set...
Apart from that I don't see any solution.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 11-05-2004, 02:51 AM   #8 (permalink)
john_tran
Registered User
 
Join Date: Oct 2004
Posts: 22
john_tran is on a distinguished road
Question

Really? Oh, i dont think so. Because we also can unhide a system file!!!
Oh, nobody know my program?
john_tran is offline   Reply With Quote
Old 11-05-2004, 03:04 AM   #9 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,709
redhead is on a distinguished road
Quote:
Oh, nobody know my program?
Are you talking about SuckIT (http://www.phrack.org/phrack/58/p58-0x07) ?
I wasn't going for a program here, I was talking about the mere programming needed to achieve the desired solution.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline   Reply With Quote
Old 11-05-2004, 04:21 AM   #10 (permalink)
john_tran
Registered User
 
Join Date: Oct 2004
Posts: 22
john_tran is on a distinguished road
No, i not use porgram like that.
I means that what i should learn to program by c++ to hide the file. Just it's all.
I see some application can do that, but i dont know how they do that. So i really want to know abou this tech.
(application set the file hide, user cannot unhide it if they do not use this program. Just only this program can unhide the file, you know what i mean?)
john_tran is offline   Reply With Quote
Old 11-06-2004, 10:18 AM   #11 (permalink)
cheawick
Regular Contributor
 
cheawick's Avatar
 
Join Date: Dec 2003
Location: Mary Esther, FL
Posts: 189
cheawick is on a distinguished road
If you could ever figure out such an ability the video game industry would be trampling down your door with offers. I agree with redhead. You would have to build an entirely new OS so that general ACSII, HEX, and other text editors wouldn't have a clue as to what the data means.
cheawick is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 04:41 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting