2

I typically develop in C# and am quite accustom to using System.IO. I recently ran across the FileIO library and have found that some of the advantages (such as sending an item to the recycle bin) are quite nice to have. Especially in the program I am currently working on. My question is, Does System.IO out perform the VisualBasic.FileIO??

My program I am writing will be copying literally TB's worth of information onto server towers. I want to make sure I do not lose any time due to the library I am using.

Thank you in advance!!!

jsmith
  • 7,198
  • 6
  • 42
  • 59

2 Answers2

10

Microsoft.VisualBasic.FileIO is built on top of System.IO (for the most part.) It should be at most as fast as System.IO for things that have direct equivalent there. The performance difference should be negligible anyway. Nothing prevents you from using both. If there's a function you need that exists in VisualBasic.FileIO and doesn't exist in System.IO, you should be using the VisualBasic.FileIO version rather than rolling your own.

Mehrdad Afshari
  • 414,610
  • 91
  • 852
  • 789
  • Which is built ontop of win32 –  Aug 22 '09 at 23:07
  • Thank you Mehrdad! That's what I was hoping, even though a lot of C# people don't like to use the Microsoft.VisualBasic library, it has some handy methods in it I'd rather not re-write! Thank you again! – jsmith Aug 23 '09 at 15:37
  • 3
    No problem. That's a stupid religious issue. Stay away from them. A wise person uses his brain rather than blindly believing religious stuff :) – Mehrdad Afshari Aug 23 '09 at 15:42
0

It is built on top of System.IO as Mehrdad mentioned but it does do a lot for you and may not be much slower. Do some perf tests between the two and see if the results are that telling that it would warrant using System.IO directly which would mean rolling your own code instead.

You may find the perf. hit isn't very big at all. :)

Kevin LaBranche
  • 20,908
  • 5
  • 52
  • 76