From daf956330f93ed9e235ae934f05a9beff45a0b63 Mon Sep 17 00:00:00 2001 From: Wei Wei Date: Mon, 22 Feb 2021 15:49:27 +0800 Subject: [PATCH] [Storage] Fix issue 14234 (#14266) --- src/Storage/Storage.Management/ChangeLog.md | 1 + src/Storage/Storage/Common/BlobToFileSystemNameResolver.cs | 2 +- src/Storage/Storage/Common/NameUtil.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Storage/Storage.Management/ChangeLog.md b/src/Storage/Storage.Management/ChangeLog.md index 0a8f3b9c4c62..fe58afd05fe0 100644 --- a/src/Storage/Storage.Management/ChangeLog.md +++ b/src/Storage/Storage.Management/ChangeLog.md @@ -34,6 +34,7 @@ - `New-AzStorageEncryptionScope` * Supported copy block blob synchronously, with encryption scope - `Copy-AzStorageBlob` +* Fixed issue that Get-AzStorageBlobContent use wrong directory separator char on Linux and MacOS [#14234] ## Version 3.3.0 * Supported RoutingPreference settings in create/update Storage account diff --git a/src/Storage/Storage/Common/BlobToFileSystemNameResolver.cs b/src/Storage/Storage/Common/BlobToFileSystemNameResolver.cs index db92219b9df3..4d575b90b126 100644 --- a/src/Storage/Storage/Common/BlobToFileSystemNameResolver.cs +++ b/src/Storage/Storage/Common/BlobToFileSystemNameResolver.cs @@ -37,7 +37,7 @@ protected override string DirSeparator { get { - return "\\"; + return Path.DirectorySeparatorChar.ToString(); } } diff --git a/src/Storage/Storage/Common/NameUtil.cs b/src/Storage/Storage/Common/NameUtil.cs index 04dabaa8be3c..5765c547f03b 100644 --- a/src/Storage/Storage/Common/NameUtil.cs +++ b/src/Storage/Storage/Common/NameUtil.cs @@ -271,7 +271,7 @@ public static string ConvertBlobNameToFileName(string blobName, DateTimeOffset? //replace dirctionary Dictionary replaceRules = new Dictionary() { - {"/", "\\"} + {"/", Path.DirectorySeparatorChar.ToString()} }; foreach (KeyValuePair rule in replaceRules)