Processing
 

Deleting files takes orders of magnitude longer when using a UNC path as opposed to a mapped drive

26/07/2016 16:55#1

Ed S.

Member

Joined at: 10 months ago

Post: 5

Thank: 0

Thanked: 0

This is a strange one. I have a folder structure which looks like this:

Folder A   File   Folder B     File x2     Folder C       File x4       Folder D         File         Folder E           Folder F             File 

I'm working on a small data utility which will, among other things, delete these folders from file to time. The test data that I am working with is very small; the entire directory contains 186KB of data.

I have noticed that, most of the time, delete operations of the entire directory are taking 15-18 minutes, which is ridiculous. After futzing around with no general idea of what the problem could be, I replaced the paths in the form of:

Directory.Delete(@"\\server\share\FolderA", true); 

With the mapped drive equivalent:

Directory.Delete(@"X:\FolderA", true); 

All of a sudden, no issue. Completely unreproducible with the mapped drive. I next tried the IP address and the issue persisted.

I should note that this doesn't happen ever time, but on the order of ~90% when using a UNC path. Again, never happens with the mapped drive notation.

Has anyone ever seen anything like this? The only thing I can think of is the per-request authentication happening when I use the UNC path, but it's hard to believe that would case the delete to take 15 minutes.

EDIT: This is obviously not a dupe of the linked thread. This has to do with massive slowdown accessing the same remote resource via a UNC path versus a mapped drive. No resources are local and the performance difference is unreasonable.

Similar articles

Window Registry create key not working in java

4 months ago - Reply: 1 - Views: 74

Metro App crash on Windows 10

4 months ago - Reply: 2 - Views: 115

.dll file missing after php upgrade

5 months ago - Reply: 1 - Views: 27

Notepad++ launch multiple HTML within browser

5 months ago - Reply: 0 - Views: 2

Access 2003 freezing

5 months ago - Reply: 0 - Views: 2

Icon Handler Shell Extension not called

5 months ago - Reply: 1 - Views: 23

Border color of combox does not change - Windows 8

5 months ago - Reply: 3 - Views: 140

VB.NET error DatagridViewCellValueChanged Windows 8

6 months ago - Reply: 1 - Views: 40

I made a mistake when installing Hyper-V [on hold]

6 months ago - Reply: 0 - Views: 7

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re