시스템 볼륨 정보 하위 폴더에서 메모리 매핑 된 파일을 열려고합니다. 탐색기에서 해당 경로가 존재하고 경로가 정확하다는 것을 알 수 있습니다 (탐색기에서 복사하여 붙여 넣음). 해당 경로의 File.Exists가 true를 반환하지만 MemoryMappedFile.OpenExisting이 DirectoryNotFoundException으로 실패합니다. 왜? (시스템 볼륨 정보 폴더 및 하위 폴더에 대한 모든 권한이 있습니다.)File.Exists가 true를 반환하고 OpenExisting이 DirectoryNotFoundException과 함께 실패합니다.
일부 코드 :
const string filePath = @"C:\\System Volume Information\\Foo\\2.ext";
bool exists = File.Exists(filePath); //is true
using (MemoryMappedFile bitmapFile = MemoryMappedFile.OpenExisting(filePath, MemoryMappedFileRights.Read)) //Throws DirectoryNotFoundException
{
...
}