You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.
I'm trying to delete all empty directories and sub-directories by using Directory.DeleteEmptySubdirectories with recursive flag.
But I'm getting exception System.IO.DirectoryNotFoundException with following message: "(3) The system cannot find the path specified: [\?\c:\temp\test\Foo\FooBar*]"
To reproduce, create following folders (Powershell):
[Alphaleonis.Win32.Filesystem.Directory]::DeleteEmptySubdirectories("c:\temp\test", $true)// even after exception all folders get deleted except C:\Temp\test\Foo.
Unhandled Exception: System.IO.DirectoryNotFoundException: (3) The system cannot find the path specified: [\\?\c:\temp\test\Foo\FooBar\*]
at Alphaleonis.Win32.NativeError.ThrowException(UInt32 errorCode, String readPath, String writePath) in D:\Coding\Projects\GitHub\AlphaFS\AlphaFS\NativeError.cs:line 83
at Alphaleonis.Win32.Filesystem.FindFileSystemEntryInfo.FindFirstFile(String pathLp, WIN32_FIND_DATA& win32FindData) in D:\Coding\Projects\GitHub\AlphaFS\AlphaFS\Filesystem\FindFileSystemEntryInfo.cs:line 120
at Alphaleonis.Win32.Filesystem.FindFileSystemEntryInfo.<Enumerate>d__3`1.MoveNext() in D:\Coding\Projects\GitHub\AlphaFS\AlphaFS\Filesystem\FindFileSystemEntryInfo.cs:line 229
at Alphaleonis.Win32.Filesystem.Directory.DeleteEmptySubdirectoriesCore(FileSystemEntryInfo fileSystemEntryInfo, KernelTransaction transaction, String path, Boolean recursive, Boolean ignoreReadOnly, Boolean initialize, PathFormat pathFormat) in D:\Coding\Projects\GitHub\AlphaFS\AlphaFS\Filesystem\Directory Class\Directory.DeleteEmptySubdirectories.cs:line 197
at Alphaleonis.Win32.Filesystem.Directory.DeleteEmptySubdirectoriesCore(FileSystemEntryInfo fileSystemEntryInfo, KernelTransaction transaction, String path, Boolean recursive, Boolean ignoreReadOnly, Boolean initialize, PathFormat pathFormat) in D:\Coding\Projects\GitHub\AlphaFS\AlphaFS\Filesystem\Directory Class\Directory.DeleteEmptySubdirectories.cs:line 197
at Alphaleonis.Win32.Filesystem.Directory.DeleteEmptySubdirectories(String path, Boolean recursive) in D:\Coding\Projects\GitHub\AlphaFS\AlphaFS\Filesystem\Directory Class\Directory.DeleteEmptySubdirectories.cs:line 41
at ConsoleApplication.Program.Main(String[] args) in c:\users\developer\documents\visual studio 2015\Projects\ConsoleApplication\ConsoleApplication\Program.cs:line 14
If execute this again:
[Alphaleonis.Win32.Filesystem.Directory]::DeleteEmptySubdirectories("c:\temp\test", $true)// after second exception all folders in C:\Temp\test are now deleted.
Unhandled Exception: System.IO.DirectoryNotFoundException: (3) The system cannot find the path specified: [\\?\c:\temp\test\Foo\*]
at Alphaleonis.Win32.NativeError.ThrowException(UInt32 errorCode, String readPath, String writePath) in D:\Coding\Projects\GitHub\AlphaFS\AlphaFS\NativeError.cs:line 83
at Alphaleonis.Win32.Filesystem.FindFileSystemEntryInfo.FindFirstFile(String pathLp, WIN32_FIND_DATA& win32FindData) in D:\Coding\Projects\GitHub\AlphaFS\AlphaFS\Filesystem\FindFileSystemEntryInfo.cs:line 120
at Alphaleonis.Win32.Filesystem.FindFileSystemEntryInfo.<Enumerate>d__3`1.MoveNext() in D:\Coding\Projects\GitHub\AlphaFS\AlphaFS\Filesystem\FindFileSystemEntryInfo.cs:line 229
at Alphaleonis.Win32.Filesystem.Directory.DeleteEmptySubdirectoriesCore(FileSystemEntryInfo fileSystemEntryInfo, KernelTransaction transaction, String path, Boolean recursive, Boolean ignoreReadOnly, Boolean initialize, PathFormat pathFormat) in D:\Coding\Projects\GitHub\AlphaFS\AlphaFS\Filesystem\Directory Class\Directory.DeleteEmptySubdirectories.cs:line 197
at Alphaleonis.Win32.Filesystem.Directory.DeleteEmptySubdirectories(String path, Boolean recursive) in D:\Coding\Projects\GitHub\AlphaFS\AlphaFS\Filesystem\Directory Class\Directory.DeleteEmptySubdirectories.cs:line 41
at ConsoleApplication.Program.Main(String[] args) in c:\users\developer\documents\visual studio 2015\Projects\ConsoleApplication\ConsoleApplication\Program.cs:line 14
The text was updated successfully, but these errors were encountered:
Hi all,
I'm trying to delete all empty directories and sub-directories by using Directory.DeleteEmptySubdirectories with recursive flag.
But I'm getting exception System.IO.DirectoryNotFoundException with following message: "(3) The system cannot find the path specified: [\?\c:\temp\test\Foo\FooBar*]"
To reproduce, create following folders (Powershell):
Then execute:
Unhandled Exception: System.IO.DirectoryNotFoundException:
If execute this again:
Unhandled Exception: System.IO.DirectoryNotFoundException:
The text was updated successfully, but these errors were encountered: