Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

feat: file-explorer working example with v0.5 #47

Merged
merged 6 commits into from
Apr 8, 2024

Conversation

tkr-sh
Copy link
Contributor

@tkr-sh tkr-sh commented Apr 6, 2024

I modified the example of the file explorer so it works with dioxus 0.5
Also I fixed the fact that before an element was determined as a file or dir based on its name: if it had a . in it.
That's a bad idea because:

  • File can have no extensions (e.g. executables (e.g. /usr/bin/*))
  • A directory can have a dot (e.g. mkdir -p this.is.a.test)

The good way to know if something is a file or a directory is to look that with the permissions (a one if it is a directory, a zero if not).
This is used with the simple:

 file.file_type().unwrap().is_dir()

Copy link
Member

@ealmloff ealmloff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating this example!

@ealmloff ealmloff merged commit 346cd52 into DioxusLabs:master Apr 8, 2024
1 check failed
@tkr-sh
Copy link
Contributor Author

tkr-sh commented Apr 8, 2024

Thanks! Appreciate the changes ^^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants