Search code examples
azureazure-storageazure-blob-storagefile-exists

Does Azure Storage function object.DeleteIfExists() check for existence when it is Invoked?


Sounds like a silly question but with .Net System.IO.FileInfo.Exists, the class checks for existence when it is instantiated, so if another process creates a file of the same name in the same place in the interval between my process instantiating FileInfo and checking FileInfo.Exists, my process will get a false negative.

Do Azure Storage objects have the same wrinkle?

Thanks.


Solution

  • No, it doesn't. It sends deletion request to Azure Storage service directly, and swallows the exception if "(404) Not Found" happens.