Alex Rivera | Logout

Is File.Exists an expensive operation?

Asked 2009-11-10T12:22:00.750
24

Re: http://msdn.microsoft.com/en-us/library/system.io.file.exists.aspx

Does anyone know if this is a particularly slow or locking operation which could impact server performance in a large environment?

Edit
Report

1 Answer

7

I don't think it is (file operations are heavily optimized and cached on most OS's) and most of the other operations are more likely to be culprits here (sockets, DB access, general processing, etc). But, as usual, the best way is to actually profile your application and see if it's an hotspot.

answered 2009-11-10T12:31:57.873

Your Answer