Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to preserve the last modified date of a file when copying between storage accounts #274

Open
andyinaus opened this issue May 20, 2021 · 0 comments

Comments

@andyinaus
Copy link

Which service(blob, file) does this issue concern?

file

Which version of the SDK was used?

version 2.0.1, 2.0.4

On which platform were you using? (.Net Framework version or .Net Core version, and OS version)

.Net Core 3.1.10

How can the problem be reproduced? It'd be better if the code caused the problem can be shared.

            var context = new DirectoryTransferContext
            {
                ProgressHandler = new Progress<TransferStatus>(progress =>
                {
                    var now = DateTime.UtcNow;

                    if (progress.NumberOfFilesTransferred - lastNumberOfFilesTransferred <= 500 && now - lastLogged < TimeSpan.FromMinutes(1))
                    {
                        return;
                    }

                    lastNumberOfFilesTransferred = progress.NumberOfFilesTransferred;
                    lastLogged = now;

                    var bytesPerSecond = progress.BytesTransferred / (now - start).TotalSeconds;
                    logger.Information($"Transferred {progress.BytesTransferred.Bytes().ToString("0.00")} / {totalString} at avg {bytesPerSecond.Bytes().ToString("0.00")} / sec. {progress.NumberOfFilesTransferred} files transferred so far.");
                }),
            };
            
await TransferManager.CopyDirectoryAsync(sourceFileDirectory, destFileDirectory, CopyMethod.ServiceSideAsyncCopy, new CopyDirectoryOptions {PreserveSMBAttributes = true, Recursive = true }, context, CancellationToken.None);

What problem was encountered?

When copying a file share directory between storage accounts, the Last Modified Date of a file/directory is not preserved even when PreserveSMBAttributes is set to true in CopyDirectoryOptions.

Have you found a mitigation/solution?

No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant