emersion / go-webdav

A Go library for WebDAV, CalDAV and CardDAV
MIT License
314 stars 66 forks source link

About the format of the return path of method "ReadDir" #163

Closed Elnus closed 4 months ago

Elnus commented 4 months ago

image

image

The code and results is shown in the picture.

For the path returned by method ReadDir in Client and LocalFileSystem,i will get different path forms from the root path and the subpath.Should we unify whether the path ends with the character "/"?

emersion commented 4 months ago

Not sure this makes sense. The client just returns whatever the server sent back.

Elnus commented 4 months ago

That's so confusing.When the Client.ReadDir passes in /temp/,it return /temp/.It seems that the return value and passed in are the same.And the sub path is not like this.I can't tell explicitly if it's a path or a file.

emersion commented 4 months ago

The only way to know whether an entry is a directory is to use the IsDir() method.

Elnus commented 4 months ago

Ok, thanks for the reply.