diff --git a/src/uu/ls/src/ls.rs b/src/uu/ls/src/ls.rs index d78e1977a..dc7ea4c08 100644 --- a/src/uu/ls/src/ls.rs +++ b/src/uu/ls/src/ls.rs @@ -1559,6 +1559,7 @@ fn get_system_time(md: &Metadata, config: &Config) -> Option { match config.time { Time::Modification => md.modified().ok(), Time::Access => md.accessed().ok(), + Time::Birth => md.created().ok(), _ => None, } } diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index eeb7a6248..cfcbf9fd1 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -559,8 +559,6 @@ fn test_ls_long_ctime() { } #[test] -#[cfg(not(windows))] -// This test is currently failing on windows fn test_ls_order_birthtime() { let scene = TestScenario::new(util_name!()); let at = &scene.fixtures; @@ -570,15 +568,11 @@ fn test_ls_order_birthtime() { After creating the first file try to sync it. This ensures the file gets created immediately instead of being saved inside the OS's IO operation buffer. - Without this, both files might accidentally be created at the same time, - even though we placed a timeout between creating the two. - - https://github.com/uutils/coreutils/pull/1986/#issuecomment-828490651 + Without this, both files might accidentally be created at the same time. */ at.make_file("test-birthtime-1").sync_all().unwrap(); - std::thread::sleep(std::time::Duration::from_millis(1)); - at.make_file("test-birthtime-2"); - at.touch("test-birthtime-1"); + at.make_file("test-birthtime-2").sync_all().unwrap(); + at.open("test-birthtime-1"); let result = scene.ucmd().arg("--time=birth").arg("-t").run();