Sunday, July 20th 2008, 2:27am UTC+1

You are not logged in.

  • Login
  • Register

SD_R3veNG

Beginner

Posts: 32

Location: Belgium

Occupation: student

1

Monday, May 12th 2008, 6:53pm

How to create a hidden file?

Hi everyone,

I'm simply trying to create a hidden file using a QFile but I cannot find a option/parameter/mode to make this file 'hidden' nor while creating it, nor after it's creation..

Since I'm using XP 32bit, I've found this documentation about the Win32-CreateFile-function: http://msdn.microsoft.com/en-us/library/aa363858.aspx

So is there a way to do this more clean? (via QT thus ;-))

thx in advance,

R3

ps: MSVC8.0, QT v4.3.3
*/ No comment /*
  • Go to the top of the page

2

Tuesday, May 13th 2008, 2:01am

RE: How to create a hidden file?

I think that QFile provides only most generic form of file access, whereas hiding files are not supported on every platform (BTW what purpose is in hiding files?). So you need to use some OS specific functions to reach your goal, but still is hardly to understand what for do it.
  • Go to the top of the page

SD_R3veNG

Beginner

Posts: 32

Location: Belgium

Occupation: student

3

Tuesday, May 13th 2008, 12:23pm

RE: How to create a hidden file?

The file I'm trying to hide contains a bunch of settings for the application I'm currently building, so I'm trying to avoid to let people just open the file in their favourite editor and edit it, possibly causing future parsing-corruption..

But anyway, you're right about that OS-specific thing.. Not every OS has this feature..

I'll save the contents of this settings-file binary then.. Should bring me to my goal :-)

Thx for your response
*/ No comment /*
  • Go to the top of the page

4

Tuesday, May 13th 2008, 2:45pm

RE: How to create a hidden file?

For purposes like tkat you have QSettings class. It store application data in OS independed manner. Of course users can still modify it, but I think your application should be careful about settings, however still you can store settings using QByteArray and QSettings which will produce results exactly as you want.
  • Go to the top of the page

Rate this thread