mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
FIx unix branch in are_paths_equal
This commit is contained in:
parent
b6fc6f4a0e
commit
ff8dbf3322
1 changed files with 2 additions and 2 deletions
|
|
@ -1,8 +1,7 @@
|
||||||
use std::{borrow::Cow, collections::{HashMap, VecDeque}, ffi::{OsStr, OsString}, fs::Metadata, path::{Path, PathBuf}};
|
use std::{borrow::Cow, collections::{HashMap, VecDeque}, ffi::{OsStr, OsString}, fs::Metadata, os::unix::fs::MetadataExt, path::{Path, PathBuf}};
|
||||||
|
|
||||||
use anyhow::{bail, Result};
|
use anyhow::{bail, Result};
|
||||||
use tokio::{fs, io, select, sync::{mpsc, oneshot}, time};
|
use tokio::{fs, io, select, sync::{mpsc, oneshot}, time};
|
||||||
use winapi_util::{file::information, Handle};
|
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub async fn must_exists(p: impl AsRef<Path>) -> bool { fs::symlink_metadata(p).await.is_ok() }
|
pub async fn must_exists(p: impl AsRef<Path>) -> bool { fs::symlink_metadata(p).await.is_ok() }
|
||||||
|
|
@ -35,6 +34,7 @@ pub async fn are_paths_equal(old: impl AsRef<Path>, new: impl AsRef<Path>) -> bo
|
||||||
}
|
}
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
{
|
{
|
||||||
|
use winapi_util::{file::information, Handle};
|
||||||
match (Handle::from_path_any(old), Handle::from_path_any(new)) {
|
match (Handle::from_path_any(old), Handle::from_path_any(new)) {
|
||||||
(Ok(old), Ok(new)) => match (information(old), information(new)) {
|
(Ok(old), Ok(new)) => match (information(old), information(new)) {
|
||||||
(Ok(old), Ok(new)) => {
|
(Ok(old), Ok(new)) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue