[GH-ISSUE #166] [Feature request] API to search and list directories #84

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

Originally created by @1024bees on GitHub (Jan 26, 2023).
Original GitHub issue: https://github.com/sigoden/dufs/issues/166

Specific Demand

An API to search for a file and show contents of a directory.

list directory API

curl http://127.0.0.1:5000/path-to-directory?list_contents=true to return a list of this files contents, analogous to running the linux command ls /path-to-directory on the server locally

search API

curl http://127.0.0.1:5000/path-to-directory?search_for=${NAME_STR} would be analogous to running the linux command find -L /path-to-directory -name "${NAME_STR}" on the server locally;

Implement Suggestion

Haven't thought about this seriously yet; I figure its best to agree on an API

Originally created by @1024bees on GitHub (Jan 26, 2023). Original GitHub issue: https://github.com/sigoden/dufs/issues/166 ## Specific Demand An API to search for a file and show contents of a directory. ### list directory API curl http://127.0.0.1:5000/path-to-directory?list_contents=true to return a list of this files contents, analogous to running the linux command `ls /path-to-directory` on the server locally ### search API curl http://127.0.0.1:5000/path-to-directory?search_for=${NAME_STR} would be analogous to running the linux command `find -L /path-to-directory -name "${NAME_STR}"` on the server locally; ## Implement Suggestion Haven't thought about this seriously yet; I figure its best to agree on an API
zhus closed this issue 2026-04-08 16:50:14 +03:00
Author
Owner

@sigoden commented on GitHub (Jan 27, 2023):

What scenarios need this kind of API ?

<!-- gh-comment-id:1406513374 --> @sigoden commented on GitHub (Jan 27, 2023): What scenarios need this kind of API ?
Author
Owner

@1024bees commented on GitHub (Jan 27, 2023):

Abstractly, a list directory API would allow end users to build file system abstractions around a given dufs server.

For my use case, I'm building a GUI that when provided a URL to a dufs server, a file tree would be displayed. imagine something like https://doc.qt.io/qt-6/qtwidgets-itemviews-dirview-example.html. the displayed files would be available on the dufs server

<!-- gh-comment-id:1406533487 --> @1024bees commented on GitHub (Jan 27, 2023): Abstractly, a list directory API would allow end users to build file system abstractions around a given dufs server. For my use case, I'm building a GUI that when provided a URL to a `dufs` server, a file tree would be displayed. imagine something like https://doc.qt.io/qt-6/qtwidgets-itemviews-dirview-example.html. the displayed files would be available on the `dufs` server
Author
Owner

@sigoden commented on GitHub (Jan 27, 2023):

Maybe add an output query string to control the output format

  • html: output web page, default
  • json: output file list, including file name, size, type and other information
  • simple: output only a list of filenames
<!-- gh-comment-id:1406557554 --> @sigoden commented on GitHub (Jan 27, 2023): Maybe add an `output` query string to control the output format - html: output web page, default - json: output file list, including file name, size, type and other information - simple: output only a list of filenames
Author
Owner

@1024bees commented on GitHub (Jan 27, 2023):

Sounds good to me, I'll look to prototype this weekend

<!-- gh-comment-id:1406577186 --> @1024bees commented on GitHub (Jan 27, 2023): Sounds good to me, I'll look to prototype this weekend
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigoden/dufs#84