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. Qt fails to copy file on ubuntu.
Forum Updated to NodeBB v4.3 + New Features

Qt fails to copy file on ubuntu.

Scheduled Pinned Locked Moved Unsolved General and Desktop
23 Posts 6 Posters 5.0k Views 3 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.
  • JonBJ JonB

    @Qingshui-Kong
    Yes and no! The question you are asking about the behaviour of a mounted USB drive, and seeming to need to either unmount or sync/fsync(), is actually a nasty area! I too would not be sure of behaviour, so it's very understandable that you are unsure :)

    Q Offline
    Q Offline
    Qingshui Kong
    wrote on last edited by
    #21

    @JonB
    OK. Thank you! I use sync to solve the problem.

    JonBJ 1 Reply Last reply
    0
    • Q Qingshui Kong

      @JonB
      OK. Thank you! I use sync to solve the problem.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #22

      @Qingshui-Kong
      Yes, that seems OK. It forces the OS to flush the pending content to the USB file, without which your problem seems to occur, so it is understandable.

      Running sync on its own asks the OS to flush all file systems, which technically you do not need. If you wish to improve on this, from a terminal run man sync to read its syntax. There you can see that if you specify the individual USB file path as an argument it will only sync/flush that file system, which is all you need.

      Q 1 Reply Last reply
      2
      • JonBJ JonB

        @Qingshui-Kong
        Yes, that seems OK. It forces the OS to flush the pending content to the USB file, without which your problem seems to occur, so it is understandable.

        Running sync on its own asks the OS to flush all file systems, which technically you do not need. If you wish to improve on this, from a terminal run man sync to read its syntax. There you can see that if you specify the individual USB file path as an argument it will only sync/flush that file system, which is all you need.

        Q Offline
        Q Offline
        Qingshui Kong
        wrote on last edited by
        #23

        @JonB OK. Thank you very much!

        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 Extensions
        • Unsolved