Results 1 to 5 of 5

Thread: QFile Permissions

  1. #1
    Join Date
    Oct 2011
    Posts
    48
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QFile Permissions

    Hi ,

    I am creating a QFile in my Qt program . I am using this file to read and write some text . I want to give permission for this file so that it cannot be edited (readonly) outside program . Can anyone tell me how can I do this?

    Thanks

  2. #2
    Join Date
    Dec 2012
    Posts
    90
    Thanks
    5
    Thanked 20 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFile Permissions


  3. #3
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFile Permissions

    Permissions are for users not for aplications.

  4. #4
    Join Date
    Oct 2011
    Posts
    48
    Thanks
    6
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QFile Permissions

    Actually the file should not be edited by anyone else. Through program I should be able to write and read to and from the file.
    Is there any method to do this?

  5. #5
    Join Date
    Dec 2012
    Posts
    90
    Thanks
    5
    Thanked 20 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QFile Permissions

    As Lesiok said, permissions is for users. So if you have a superuser/administrator on the machine it can do anything he likes.
    The one way you can go about it is run your application under different user, and save your file in places that hidden from another users (althought superuser can modify your file nevertheless)

    Another way is to encrypt your file.

Similar Threads

  1. QDir::mkPath and Permissions
    By sky in forum Qt Programming
    Replies: 1
    Last Post: 2nd July 2013, 17:35
  2. Replies: 4
    Last Post: 18th March 2011, 05:17
  3. Finding user permissions
    By doggrant in forum Qt Programming
    Replies: 6
    Last Post: 22nd October 2009, 19:05
  4. Replies: 1
    Last Post: 27th September 2008, 20:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.