Results 1 to 2 of 2

Thread: How to use stat() function in Qt?

  1. #1
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default How to use stat() function in Qt?

    I am using stat function to return the filesize? But it returns -1 everytime.. Or some garbage filesize. How to get the correct file size?
    in Windows 7 64 bit.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to use stat() function in Qt?

    This is not a Qt question. If you were using QFileInfo or QFile to get the file size this would be a Qt question.

    Hint: the standard stat() function's return value is not the file size, and -1 means something. The file attributes are returned in the buffer you pass a pointer to.
    Last edited by ChrisW67; 6th August 2012 at 09:18.

Similar Threads

  1. Replies: 4
    Last Post: 2nd August 2012, 07:42
  2. Replies: 3
    Last Post: 23rd January 2011, 12:15
  3. Replies: 3
    Last Post: 25th May 2010, 09:46
  4. Replies: 0
    Last Post: 10th March 2010, 08:13
  5. can't stat libqte.so.3.3.6
    By octopia in forum Installation and Deployment
    Replies: 1
    Last Post: 3rd July 2006, 15:33

Tags for this Thread

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.