Results 1 to 2 of 2

Thread: Exclude /proc being watched by the intfilesystemwatcher installed by QFileSystemModel

  1. #1
    Join Date
    Mar 2015
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Exclude /proc being watched by the intfilesystemwatcher installed by QFileSystemModel

    Hi,

    I am trying to display "/" in a treeView. I have a QFileSystemModel with setRootIndex("/"). I want to do some deep file search on this fileSystemModel. So create a signal/slot connection
    Qt Code:
    1. connect(fileModel, SIGNAL(directoryLoaded(QString), this, on_dir_tree_loaded() ))
    To copy to clipboard, switch view to plain text mode 

    The problem is that the internal QFileSystemWatcher attached to QFileSystemModel never finishes reading /proc and spits out error messages like
    Qt Code:
    1. QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: Permission denied
    2. QFileSystemWatcher: failed to add paths: /proc/57/task/57/ns
    To copy to clipboard, switch view to plain text mode 

    I guess that there are new system processes continuously making entries inside /proc and are causing the problem.

    How can I exclude /proc being watched, or alternatively get around this problem?

    Cheers,
    Kodanda

  2. #2
    Join Date
    Dec 2009
    Location
    New Orleans, Louisiana
    Posts
    791
    Thanks
    13
    Thanked 153 Times in 150 Posts
    Qt products
    Qt5
    Platforms
    MacOS X

    Default Re: Exclude /proc being watched by the intfilesystemwatcher installed by QFileSystemM

    I am assuming / and /proc are different mount points in your file system? If so, can you just iterate over the various mount points and only add those to QFileSystemWatcher that you actually want to watch?

    i.e. Use QStorageInfo::mountedVolumes()?

    Edit: One more thought, have you tried removing /proc after you set the root to "/"? Perhaps QFileSystemWatcher::removePath("/proc") may accomplish what you want?
    Last edited by jefftee; 26th March 2015 at 20:29.

Similar Threads

  1. Replies: 3
    Last Post: 22nd February 2013, 12:05
  2. Exclude items in QGraphicsItem::collidingItems
    By Affenbrotbaum in forum Newbie
    Replies: 4
    Last Post: 22nd January 2010, 20:45
  3. stored proc with QtSql
    By xyzt in forum Qt Programming
    Replies: 1
    Last Post: 17th February 2009, 09:12
  4. [SXE] Can not find /proc/lids/keys
    By nice295@gmail.com in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th February 2009, 01:06
  5. QProcess *proc at top of source (global?)
    By BrainFreeze in forum Qt Programming
    Replies: 4
    Last Post: 5th February 2008, 05:15

Tags for this Thread

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.