Hello I want to write a file in Linux/Windows and in the same time of writing I want that nobody can open the file for reading and for writing.
With QIODevice::WriteOnly I can open the file with gEdit is that normal?
Printable View
Since you executed the program, any files created will default to being owned by you. You have permission to read and write your own files. Users tend to get very upset otherwise, when programs litter their system with files that can't be deleted.
Note that QFile allows you to set a wide range of permissions.
But also setting permissions will not help me.
I launch my qt program which write the file and I can also open it with an other program.
In Windows you can create a file with execlusiv rights, that's what I want to do with QT
I don't know what 'exclusive rights' are, but someone - usually the owner, sometimes others - will always be able to read/write a file they've created. Any program that creates files in my user space that I am unable to manipulate is a program that will be headed to the trash heap in an instant.
If you can't set file permissions (and that's what they are) to what you'd like them to be using QFile, make a system call to the Windows API.
I think he means a mandatory lock. That's possible for Windows but not for Linux since locking is not mandatory there on most filesystems.
http://doc.trolltech.com/solutions/4...ockedfile.html