wait_for_file_modified

emlib.misc.wait_for_file_modified(path, timeout=0.0)[source]

Wait until file is modified.

This is useful when editing a file on an external application which runs in a daemon mode, meaning that opening a file in it might return immediately.

Parameters:
  • path (str) – the path of the file to monitor

  • timeout (int | float) – how long should we wait for, in seconds

Return type:

bool

Returns:

True if the file was modified, False if it wasn’t or if the operation timed-out