1

I'm trying to copy files from one location on a fileshare into another location. I'm fetching attributes and then using startcopyasync. The metadata persists but the last modified date and etag change.

StartCopy says it copies metadata and properties but it seems like it only copies metadata to me.

var currentFile = srcDir.GetFileReference(((CloudFile) item).Name);
currentFile.FetchAttributes();
var destFile = destDir.GetFileReference(((CloudFile) item).Name);                       
await destFile.StartCopyAsync(currentFile);

Does it not actually copy lastmodified date? Am I doing something wrong? I can't find good documentation on this exact situation.

1 Answers1

0

Refer to the suggestion mentioned in the below mentioned links Storing file created date in Azure File Storage

Getting the latest file modified from Azure Blob

Kindly let us know if the above helps or you need further assistance on this issue.

  • Yeah I ended up just storing the modified date in the metadata. But then I have to keep track of it. StartCopy says it copies the properties of the cloudfile over but that doesn't seem to apply to modified date or etag. I want it to work like a folder on my actual system. If I copy it and paste it somewhere else that doesn't affect its modified date. I was wondering if it didn't work like my mental model, or if it did and I was doing something wrong. – Brandon West Jul 10 '19 at 19:51