orhun/binsider

Support displaying general file information on Windows

开放

#35 创建于 2024年9月17日

 (0 条评论) (1 个反应) (0 位负责人)Rust (105 个派生)auto 404
effort: mediumenhancementgood first issuehelp wanted

仓库指标

星标
 (4,333 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Is your feature request related to a problem? Please describe.

binsider now support Windows (when building via --no-default-features) after #31, however the general file information is not available due to the Rust API differences between Linux.

See the failed workflow for more information: https://github.com/orhun/binsider/actions/runs/10902683795/job/30255132721?pr=31

We need to solve these build errors via refactoring file.rs in a more generic way.

Unfortunately I don't have a development environment for Windows and running the following command again and again on Linux is not very convenient for developing/testing this:

cross build --target x86_64-pc-windows-gnu --no-default-features

Describe the solution you'd like

One idea is to create a trait called PlatformFileInfo (I'm bad at naming) and implement it for FileInfo for having generalized functions for both Linux and Windows. Eventually update ui.rs and other related files to render the file information correctly.

To do this, one should also remove the if cfg!(target_os = "windows") checks. See 83657f98b783286f04a5b9c75b36246582f31d42 for more information.

Describe alternatives you've considered

None. I'm open to ideas though!

Additional context

See:

https://doc.rust-lang.org/stable/std/os/linux/fs/trait.MetadataExt.html

vs

https://doc.rust-lang.org/stable/std/os/windows/fs/trait.MetadataExt.html

贡献者指南