You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.tox/py310-tests/lib/python3.10/site-packages/xxx/xxx/wait.py:22: in wait_for_file
observer.start()
.tox/py310-tests/lib/python3.10/site-packages/watchdog/observers/api.py:264: in start
emitter.start()
.tox/py310-tests/lib/python3.10/site-packages/watchdog/utils/__init__.py:75: in start
self.on_thread_start()
.tox/py310-tests/lib/python3.10/site-packages/watchdog/observers/inotify.py:119: in on_thread_start
self._inotify = InotifyBuffer(path, recursive=self.watch.is_recursive, event_mask=event_mask)
.tox/py310-tests/lib/python3.10/site-packages/watchdog/observers/inotify_buffer.py:30: in __init__
self._inotify = Inotify(path, recursive=recursive, event_mask=event_mask)
.tox/py310-tests/lib/python3.10/site-packages/watchdog/observers/inotify_c.py:165: in __init__
self._add_watch(path, event_mask)
.tox/py310-tests/lib/python3.10/site-packages/watchdog/observers/inotify_c.py:377: in _add_watch
Inotify._raise_error()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
@staticmethod
def _raise_error() -> None:
"""Raises errors for inotify failures."""
err = ctypes.get_errno()
if err == errno.ENOSPC:
raise OSError(errno.ENOSPC, "inotify watch limit reached")
if err == errno.EMFILE:
raise OSError(errno.EMFILE, "inotify instance limit reached")
if err != errno.EACCES:
> raise OSError(err, os.strerror(err))
E FileNotFoundError: [Errno 2] No such file or directory
This is odd because it is true that the file does not exist, but my intent here is to wait for its creation. Is there anyway to achieve this intent on linux (works on Mac)?
The text was updated successfully, but these errors were encountered:
You are right, once I changed to watch the directory where the file was housed this worked. However I do feel this is odd, theres nothing that would indicate to me that this can't or shouldn't be done, after all I am interested in consuming file system events including creation, and I think its reasonable to watch a path that doesn't exist for an event such as creation which can only happen when the object starts in a state of non-existence. This confusion is compounded by the idea it works on Mac in this way but Linux behaves differently, when from the consumption of the library these should behave the same.
I have the following code that watches a path with the intent to signal when a file is created:
I receive the following error:
This is odd because it is true that the file does not exist, but my intent here is to wait for its creation. Is there anyway to achieve this intent on linux (works on Mac)?
The text was updated successfully, but these errors were encountered: