Results 1 to 3 of 3

Thread: Check file is in Use

  1. #1
    Join Date
    Jul 2010
    Posts
    33
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Check file is in Use

    Hi,

    Is there any method in Qt to identify that file is in use.

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: Check file is in Use

    Not in Qt.
    Search the forum, this question has been asked before. There are a couple of techniques you can try like getting an exclusive lock on the file. If it works, you're the only one using it. If the exclusive lock fails, someone else already opened the file. But thats just a guess as I never tried this. And it might not work on all operating systems.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Check file is in Use

    It will certainly not work on all operating systems. In Unix environment you need superuser privileges to know if a file is opened by some other process.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Best way to check if file is successfully sent over QTcpSocket
    By cutie.monkey in forum Qt Programming
    Replies: 5
    Last Post: 17th October 2009, 20:24
  2. Check file is modified?
    By mamyte03@gmail.com in forum Qt Programming
    Replies: 6
    Last Post: 20th September 2007, 13:03
  3. How to check a file for changes since last save
    By nmather in forum General Programming
    Replies: 2
    Last Post: 21st April 2007, 23:43
  4. Check for compressed .qm file?
    By ksierens in forum Qt Programming
    Replies: 2
    Last Post: 2nd November 2006, 19:52
  5. Check if a file has been modified
    By Dark_Tower in forum Qt Programming
    Replies: 6
    Last Post: 13th April 2006, 21:27

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.