New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File events inside a folder will only work with wxFileSystemWatcher if the folder path has a trailing slash #17277
Comments
2015-12-04 19:03:56: halfer commentedI have tested this behaviour on GNU/Linux Ubuntu 14.04, PHP 5.5.9-1ubuntu4.14. |
Confirmed same behavior with wxPython on Linux. This works as you would expect with def CreateFileSystemWatcher(self):
self._fswatcher = wx.FileSystemWatcher()
self._fswatcher.Bind(wx.EVT_FSWATCHER, self.OnFSEvent)
self.inbox = os.path.join(self.library.dir, 'inbox/')
os.makedirs(self.inbox, exist_ok=True)
self._fswatcher.Add(self.inbox) This still fires events, but def CreateFileSystemWatcher(self):
self._fswatcher = wx.FileSystemWatcher()
self._fswatcher.Bind(wx.EVT_FSWATCHER, self.OnFSEvent)
self.inbox = os.path.join(self.library.dir, 'inbox')
os.makedirs(self.inbox, exist_ok=True)
self._fswatcher.Add(self.inbox) There's a Google Groups thread for 2013 confirming the same behavior on wxPython MSW as well. |
Is |
In my case, |
I believe that generally, when working with paths in wxWidgets (e.g., using |
Issue migrated from trac ticket # 17277
component: wxX11 | priority: normal
2015-12-04 19:01:01: halfer created the issue
I recently implemented a wxFileSystemWatcher (wxphp/wxphp#113) in wxPHP, and found an interesting thing. To monitor what happens inside a folder with add(), the directory needs to have a trailing slash. I've found that without the slash, events are received OK but filenames of created/deleted files are not included in the notification.
The maintainer of wxPHP doesn't seem to think this behaviour is introduced on the PHP side, so we wonder if it might be introduced upstream? If so, is this deliberate?
This occurs with wxPHP built against 3.0.2 of wxWidgets.
I'd be more than happy to run any wxPHP tests if it is helpful.
The text was updated successfully, but these errors were encountered: