dave icon indicating copy to clipboard operation
dave copied to clipboard

Clients expecting response/propstat/prop/creationdate

Open jwise-mfg opened this issue 3 years ago • 2 comments

Would it be possible to implement the creationdate prop element? Its a peer element to getlastmodified, and apparently suggested RFC4437. Not a huge deal (and I actually don't see it in the RFC) but I'm working with an older client that crashed because it was missing (I patched this particular client, but others may have trouble.)

Thanks for building this, its awesome!

jwise-mfg avatar Mar 18 '21 20:03 jwise-mfg

Sample code... but it looks like this is a Windows-only feature 👎 in props.go > liveProps

	{Space: "DAV:", Local: "creationdate"}: {
		findFn: findCreationDate,
		dir:    false,
	},

and as a new method in the same file

func findCreationDate(ctx context.Context, fs FileSystem, ls LockSystem, name string, fi os.FileInfo) (string, error) {
	d := fi.Sys().(*syscall.Win32FileAttributeData)
	cTime = time.Unix(0, d.CreationTime.Nanoseconds())
	return fi.CreateTime().UTC().Format(http.TimeFormat), nil
}

Sorry, I'm new to Go, so you probably don't want my advice 😄

jwise-mfg avatar Mar 18 '21 20:03 jwise-mfg

Hi,

thanks for the information and thanks for the thanks. ;)

Unfortunately the potentially changes you mentioned comes directly from the golang webdav standard library (props.go comes from golang.org/x/net/webdav) which is instrumented by dave. I see no lightweight possibility to enable more webdav features than given by the library.

Sorry for that.

chclaus avatar Apr 07 '21 15:04 chclaus