mirror of
https://github.com/1f349/go-webdav.git
synced 2024-12-23 00:34:23 +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)
|
id := fs.addressObjectID(name)
|
||||||
_, err := fs.ab.GetAddressObject(id)
|
ao, err := fs.ab.GetAddressObject(id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info, err := ao.Stat()
|
||||||
|
if info != nil || err != nil {
|
||||||
|
return info, err
|
||||||
|
}
|
||||||
|
|
||||||
return &fileInfo{
|
return &fileInfo{
|
||||||
name: name,
|
name: name,
|
||||||
mode: os.ModePerm,
|
mode: os.ModePerm,
|
||||||
|
Loading…
Reference in New Issue
Block a user