Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Regarding Accessing a single file by two process.
Qt 6.12 LTS is out! See what's new in the release blog

Regarding Accessing a single file by two process.

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 3.0k 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.
  • I Offline
    I Offline
    Indrajeet
    wrote on last edited by
    #1

    Hi All

    I have written a 2 functions to read & write a file.

    Problem:
    There is a single file which will be read or written by different processes.
    So how to avoid the process to read or write the file when some other process is performing the task on that file.
    or processes can read the file but if one process is writing that file at that time no other process should read it or write it.

    Please explain with example.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      "QSystemSemaphore":http://doc.qt.nokia.com/latest/qsystemsemaphore.html (examples inside)

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        "Again ?":http://developer.qt.nokia.com/forums/viewthread/7084/

        "QSystemSemaphore":http://developer.qt.nokia.com/doc/qt-4.7/qsystemsemaphore.html

        For more informations about your problem see "Readers-Writers-Problem":http://en.wikipedia.org/wiki/Readers-writers_problem

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #4

          Closing this one as a duplicate of http://developer.qt.nokia.com/forums/viewthread/7084/.

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            ... and moved to general and desktop section as this is definitely not for the guru group.

            1 Reply Last reply
            0

            • Login

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