Results 1 to 3 of 3

Thread: getting filelength

  1. #1
    Join Date
    Aug 2009
    Posts
    81
    Platforms
    MacOS X Windows

    Default getting filelength

    hello what is the fastest way to get a filelength with qt?

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

    Default Re: getting filelength

    QFile.size() returns a qint64 representing the size of the file in bytes.

    See http://doc.trolltech.com/4.5/qfile.html#size
    Last edited by Tino; 2nd August 2009 at 18:36.

  3. #3
    Join Date
    Jul 2007
    Location
    BY.Minsk
    Posts
    90
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: getting filelength

    Quote Originally Posted by eric_vi View Post
    hello what is the fastest way to get a filelength with qt?
    Qt Code:
    1. QFile fSomeFile("d:/myfile.ext");
    2. qint64 nFileSize = fSomeFile.size(); //in bytes
    3. qDebug() << nFileSize;
    To copy to clipboard, switch view to plain text mode 

  4. The following user says thank you to Fastman for this useful post:

    ihope (11th August 2009)

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.