Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symbolic/hard Link, virtual folders like sftpgo, list directory above if view files by browser support #239

Closed
lynks529 opened this issue Jun 30, 2023 · 13 comments

Comments

@lynks529
Copy link

Specific Demand

Symbolic/Hard Link Support

I found that dufs can't list symbolic link entries.

Dynamic virtual folders like sftpgo

When running dufs, you may need add some virtual folders to transfers files.

Instead of running another instance and using another port.

list directory above if view files by browser

We prefer folders above and files below.

Implement Suggestion

@sigoden
Copy link
Owner

sigoden commented Jun 30, 2023

I don't understand what you're saying. can you give an example ?

dufs supports symlink.

@lynks529
Copy link
Author

lynks529 commented Jul 1, 2023

use std::fs;
use std::io;
use std::path::Path;

fn visit_dirs(dir: &Path) -> io::Result<()> {
    if dir.is_dir() {
        for entry in fs::read_dir(dir)? {
            let entry = entry?;
            let path = entry.path();
            if path.is_dir() && path.is_symlink() {
                print!("dir symlink: ");
            } else {
                print!("not dir symlink: ");
            }
            print!("{:?}", path);
            println!();
        }
    }
    Ok(())
}

fn main() {
    let path = Path::new("C:/Volumes");
    visit_dirs(path);
}

Run cargo run result:

dir symlink: "C:/Volumes\\deno-x86_64-1.34.3-pc-windows-msvc.zip"
dir symlink: "C:/Volumes\\flutter_windows_3.10.5-stable.zip"
not dir symlink: "C:/Volumes\\New folder"
dir symlink: "C:/Volumes\\New folder - Junction"
dir symlink: "C:/Volumes\\New folder - SymbolicLink"
not dir symlink: "C:/Volumes\\New Text Document - SymbolicLink.txt"
not dir symlink: "C:/Volumes\\New Text Document.txt"

C:/Volumes\\deno-x86_64-1.34.3-pc-windows-msvc.zip and C:/Volumes\\flutter_windows_3.10.5-stable.zip are virtual folders create by Pismo File Mount Audit Package build 192-win.exe, which used to mount archive files.

Run dufs C:\Volumes, and open http://127.0.0.1:5000/, page no show that two virtual folders, just:

NameLast                                                         Modified                     Size       Actions
New folder                                                        2023-07-01 14:13 		
New folder - Junction                                       2023-07-01 14:13 		
New folder - SymbolicLink                               2023-07-01 14:13 		
New Text Document.txt                                    2023-07-01 14:12    	0 B 	
New Text Document - SymbolicLink.txt            2023-07-01 14:12    	0 B 	

@lynks529
Copy link
Author

lynks529 commented Jul 1, 2023

Sort by names folders not above

Run dufs C:\Volumes, and open http://127.0.0.1:5000/?order=desc&sort=name, page shows:

[Name](http://127.0.0.1:5000/?order=asc&sort=name)
New Text Document.txt
New Text Document - SymbolicLink.txt
New folder - SymbolicLink
New folder - Junction
New folder

@sigoden
Copy link
Owner

sigoden commented Jul 1, 2023

You need to run with "--allow-symlink" or "--allow-all"

@sigoden
Copy link
Owner

sigoden commented Jul 1, 2023

sort by name, in desc order, what's the problem?

@lynks529
Copy link
Author

lynks529 commented Jul 1, 2023

You need to run with "--allow-symlink" or "--allow-all"

Thanks, that's OK.

@lynks529
Copy link
Author

lynks529 commented Jul 1, 2023

sort by name, in asc order, what's the problem?

Could this sort features can display entries like Windows Explorer, folders has high priority.

@sigoden
Copy link
Owner

sigoden commented Jul 1, 2023

Not sure, I need to do some research.

@lynks529
Copy link
Author

lynks529 commented Jul 1, 2023

Dynamic virtual folders like sftpgo

Dynamicly map real directories to webdav root subdirs.

eg.: Map C:\_File_Cache of C partition to webdav path /_File_Cache.

@sigoden
Copy link
Owner

sigoden commented Jul 1, 2023

Isn't it just dufs C:\

@sigoden sigoden closed this as completed Jul 1, 2023
@lynks529
Copy link
Author

lynks529 commented Jul 1, 2023

Isn't it just dufs C:\

Many partitions, not only C:.

@sigoden
Copy link
Owner

sigoden commented Jul 1, 2023

Then you create symlinks such as D: => C:\D E: => C:\E,

You should study yourself, try and chek.

@lynks529
Copy link
Author

lynks529 commented Jul 1, 2023

Then you create symlinks such as D: => C:\D E: => C:\E,

You should study yourself, try and chek.

Thanks, maybe I'll tweak it.

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

No branches or pull requests

2 participants