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
Thank you for your great work on linemux. I just started learning Rust (coming from a Python background) and as a first project I'm working on async-tail, which is basically a Python wrapper around linemux, providing both a sync and async interfaces (using Rust bindings for Python, using pyo3).
In the process I've noticed that linemux is not yielding updates from a tailed file (only on OSX) if the file doesn't exist already when registered for tailing. It's only happening on macOS but is easily reproducible using the example code from linemux README:
use linemux::MuxedLines;use std::env;#[tokio::main]asyncfnmain() -> std::io::Result<()>{letmut lines = MuxedLines::new()?;// Register some files to be tailed, whether they currently exist or not.
lines.add_file("/xxx/tail.log").await?;println!("{:?}", env::current_dir());// Wait for `Line` event, which contains the line captured for a given// source path.whileletOk(Some(line)) = lines.next_line().await{println!("source: {}, line: {}", line.source().display(), line.line());}Ok(())}
If I create an empty tail.log file before running the above, it'll work great and I will be notified of updates whenever new lines are added.
However if the file does not exist before I run the above, I won't get notified of any updates.
This only happens on macos (tried on centos without any problems).
Maybe you were already aware of that problem but I just wanted to make sure, so please let me know if I'm doing anything wrong or if I can help in any way, I'm happy to try as much as I can or provide you with any additional information. Also, I'm not sure if this is caused by linemux or is only related to notify.
(For reference, I ran the above example on a M1 Macbook -MacOS big sur)
The text was updated successfully, but these errors were encountered:
Thanks for the head's up. I've also got a M1 and will try to repro. There does exist a test_add_missing_files unit test which is run against macos on GHA, but I suspect the underlying logic isn't catching all possible signals.
Hi @jmagnuson ,
Thank you for your great work on
linemux
. I just started learning Rust (coming from a Python background) and as a first project I'm working on async-tail, which is basically a Python wrapper aroundlinemux
, providing both a sync and async interfaces (using Rust bindings for Python, usingpyo3
).In the process I've noticed that
linemux
is not yielding updates from a tailed file (only on OSX) if the file doesn't exist already when registered for tailing. It's only happening on macOS but is easily reproducible using the example code fromlinemux
README:If I create an empty
tail.log
file before running the above, it'll work great and I will be notified of updates whenever new lines are added.However if the file does not exist before I run the above, I won't get notified of any updates.
This only happens on macos (tried on centos without any problems).
Maybe you were already aware of that problem but I just wanted to make sure, so please let me know if I'm doing anything wrong or if I can help in any way, I'm happy to try as much as I can or provide you with any additional information. Also, I'm not sure if this is caused by
linemux
or is only related tonotify
.(For reference, I ran the above example on a M1 Macbook -MacOS big sur)
The text was updated successfully, but these errors were encountered: