[GH-ISSUE #239] Symbolic/hard Link, virtual folders like sftpgo, list directory above if view files by browser support #121

Closed
opened 2026-04-08 16:50:31 +03:00 by zhus · 13 comments
Owner

Originally created by @lynks529 on GitHub (Jun 30, 2023).
Original GitHub issue: https://github.com/sigoden/dufs/issues/239

Specific Demand

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

Originally created by @lynks529 on GitHub (Jun 30, 2023). Original GitHub issue: https://github.com/sigoden/dufs/issues/239 ## Specific Demand <!-- What feature do you need, please describe it in detail. --> ### 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 <!-- If you have any suggestion for complete this feature, you can tell us. -->
zhus closed this issue 2026-04-08 16:50:31 +03:00
Author
Owner

@sigoden commented on GitHub (Jun 30, 2023):

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

dufs supports symlink.

<!-- gh-comment-id:1614784399 --> @sigoden commented on GitHub (Jun 30, 2023): I don't understand what you're saying. can you give an example ? dufs supports symlink.
Author
Owner

@lynks529 commented on GitHub (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 	
<!-- gh-comment-id:1615558775 --> @lynks529 commented on GitHub (Jul 1, 2023): ```rust 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: ```text 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 ```
Author
Owner

@lynks529 commented on GitHub (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
<!-- gh-comment-id:1615563718 --> @lynks529 commented on GitHub (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 ```
Author
Owner

@sigoden commented on GitHub (Jul 1, 2023):

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

<!-- gh-comment-id:1615563931 --> @sigoden commented on GitHub (Jul 1, 2023): You need to run with "--allow-symlink" or "--allow-all"
Author
Owner

@sigoden commented on GitHub (Jul 1, 2023):

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

<!-- gh-comment-id:1615569225 --> @sigoden commented on GitHub (Jul 1, 2023): sort by name, in desc order, what's the problem?
Author
Owner

@lynks529 commented on GitHub (Jul 1, 2023):

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

Thanks, that's OK.

<!-- gh-comment-id:1615569477 --> @lynks529 commented on GitHub (Jul 1, 2023): > You need to run with "--allow-symlink" or "--allow-all" Thanks, that's OK.
Author
Owner

@lynks529 commented on GitHub (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.

<!-- gh-comment-id:1615572044 --> @lynks529 commented on GitHub (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.
Author
Owner

@sigoden commented on GitHub (Jul 1, 2023):

Not sure, I need to do some research.

<!-- gh-comment-id:1615577068 --> @sigoden commented on GitHub (Jul 1, 2023): Not sure, I need to do some research.
Author
Owner

@lynks529 commented on GitHub (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.

<!-- gh-comment-id:1615577445 --> @lynks529 commented on GitHub (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`.
Author
Owner

@sigoden commented on GitHub (Jul 1, 2023):

Isn't it just dufs C:\

<!-- gh-comment-id:1615578712 --> @sigoden commented on GitHub (Jul 1, 2023): Isn't it just `dufs C:\` ?
Author
Owner

@lynks529 commented on GitHub (Jul 1, 2023):

Isn't it just dufs C:\

Many partitions, not only C:.

<!-- gh-comment-id:1615580563 --> @lynks529 commented on GitHub (Jul 1, 2023): > Isn't it just `dufs C:\` ? Many partitions, not only `C:`.
Author
Owner

@sigoden commented on GitHub (Jul 1, 2023):

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

You should study yourself, try and chek.

<!-- gh-comment-id:1615585234 --> @sigoden commented on GitHub (Jul 1, 2023): Then you create symlinks such as `D: => C:\D` `E: => C:\E`, You should study yourself, try and chek.
Author
Owner

@lynks529 commented on GitHub (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.

<!-- gh-comment-id:1615587240 --> @lynks529 commented on GitHub (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 in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#121