mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-22 16:24:14 +00:00
Use AddressObject.Stat if supported
This commit is contained in:
parent
7d69432517
commit
8d4a1ede86
@ -284,11 +284,16 @@ func (fs *fileSystem) Stat(ctx context.Context, name string) (os.FileInfo, error
|
||||
}
|
||||
|
||||
id := fs.addressObjectID(name)
|
||||
_, err := fs.ab.GetAddressObject(id)
|
||||
ao, err := fs.ab.GetAddressObject(id)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
info, err := ao.Stat()
|
||||
if info != nil || err != nil {
|
||||
return info, err
|
||||
}
|
||||
|
||||
return &fileInfo{
|
||||
name: name,
|
||||
mode: os.ModePerm,
|
||||
|
Loading…
Reference in New Issue
Block a user