Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. what is qt equivalent code for fseek and SEEK_END flag of c ?
Qt 6.11 is out! See what's new in the release blog

what is qt equivalent code for fseek and SEEK_END flag of c ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 482 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by
    #1

    i want to get qt equivalent code for below statement
    fseek(fp, -543, SEEK_END);

    JKSHJ 1 Reply Last reply
    0
    • Q Qt embedded developer

      i want to get qt equivalent code for below statement
      fseek(fp, -543, SEEK_END);

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @Qt-embedded-developer said in what is qt equivalent code for fseek and SEEK_END flag of c ?:

                  fseek(fp, -543, SEEK_END);
      

      So you want to seek to 543 bytes before the end of the file.

      QFile does not have a SEEK_END flag, but you can use the file size to calculate your final position (file.size() - 543). Pass the position to QFile::seek().

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      6

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved