Results 1 to 7 of 7

Thread: How to create a directory with hidden attribute

  1. #1
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default How to create a directory with hidden attribute

    Hi,

    I am facing very small issue with creating directory with hidden attribute.

    How to create a directory with hidden attribute. Strangely i could not found anything like this.


    regards,
    ~Sanjay

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to create a directory with hidden attribute

    Quote Originally Posted by sanjayshelke View Post
    I am facing very small issue with creating directory with hidden attribute.How to create a directory with hidden attribute. Strangely i could not found anything like this
    There is not a platform independant way to do that.
    On linux you can easily achieve it by calling :
    Qt Code:
    1. QDir dir;
    2. dir.mkdir(".I_AM_HIDDEN");//Dot in starting of name
    To copy to clipboard, switch view to plain text mode 

    And for windows click here.
    Last edited by yogeshgokul; 11th November 2009 at 07:09.

  3. #3
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to create a directory with hidden attribute

    Thanks a lot for this information.

    I was thinking that there must be some way to do that using Qt ( without using platform dependant code ).

    How about the Mac OS X?

  4. #4
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to create a directory with hidden attribute

    Quote Originally Posted by sanjayshelke View Post
    THow about the Mac OS X?
    Its also UNIX based so ideally "dot before name" method should work.

  5. #5
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to create a directory with hidden attribute

    Quote Originally Posted by sanjayshelke View Post
    I was thinking that there must be some way to do that using Qt ( without using platform dependant code ).
    Qt has "setPermissions" but these don't include hidden attribute as only Windows has that function. Therefore you need to create a directory with a name starting with a '.' and then if on Windows you need to use windows-specific code to make that directory hidden. Some platforms may not support directories starting with a '.' (some smartphones).

    There is no platform independant way of doing this.

  6. #6
    Join Date
    Jul 2007
    Posts
    90
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to create a directory with hidden attribute

    Thanks a lot.

    Yes finally i implemented the platform specific code for windows and Mac os x.

    Mac OS X is unix based so putting '.' in front of the file makes the file hidden.


    Thanks again.

  7. #7
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to create a directory with hidden attribute

    Can you share ?

Similar Threads

  1. some questions about install qwt
    By dycjiaoda in forum Qwt
    Replies: 1
    Last Post: 8th February 2011, 01:37
  2. install help nedded.
    By aj2903 in forum Installation and Deployment
    Replies: 9
    Last Post: 13th November 2008, 07:57
  3. Replies: 2
    Last Post: 27th October 2007, 18:16
  4. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  5. create file in another directory
    By raphaelf in forum Qt Programming
    Replies: 3
    Last Post: 16th February 2006, 10:04

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.