Skip to content

Conversation

skunkie
Copy link

@skunkie skunkie commented Aug 12, 2025

These changes allow using any fs.FS implementation.

This commit allows using any fs.FS implementation.
Copy link
Owner

@anacrolix anacrolix left a comment

Choose a reason for hiding this comment

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

Looks thorough. I just wonder if changing everything from being rooted at / to . will work as expected. That rooting is on the UPnP side, I may have just made it up but it isn't a local file path.

if len(o.Path) == 1 {
return "0"
}
return url.QueryEscape(o.Path)
}

func (o *object) IsRoot() bool {
return o.Path == "/"
return o.Path == "."
Copy link
Owner

Choose a reason for hiding this comment

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

Are you sure about changing this part? Same with the other usage. Can you make / rooted in whatever subtree fs.FS is?

Copy link
Author

Choose a reason for hiding this comment

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

The . (dot) in the context of fs.FS generally refers to the root of the file system represented by that specific fs.FS instance. It is not necessarily the current working directory of the operating system, but rather the base or starting point of the abstract file system being exposed by the fs.FS implementation.

Copy link
Owner

Choose a reason for hiding this comment

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

Ah yeah, the interface I was going for was to expose / as the root of the FS exposed to the device. I understand . would be used on the server side that makes sense.

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

Successfully merging this pull request may close these issues.

2 participants