FileInfo connection.

  • Thread starter Thread starter Andrew
  • Start date Start date
A

Andrew

Question: How do you close the FileInfo connection?? there is no
original.Close()...

Thanks in advance

regards,
Andrew
 
Andrew said:
Question: How do you close the FileInfo connection?? there is no
original.Close()...

Thanks in advance

regards,
Andrew

Andrew,

You shouldn't have to close or dispose of the FileInfo instance you are
using.

1.) Not positive, but I don't think the FileInfo has a lock in place on the
file when it's in use.
2.) FileInfo doesn't implement IDisposable so you can't "Dispose" of it (no
Dispose method to call).

HTH,
Mythran
 
Question: How do you close the FileInfo connection?? there is no
original.Close()...

Thanks in advance

regards,
Andrew

It's not needed.
 
Andrew said:
Question: How do you close the FileInfo connection?? there is no
original.Close()...

I believe FileInfo is a class holding only data about the file - managed
data - not any unmanaged operating system resources keeping the file
open.

If that is correct then you don't need any Close (or Dispose). Regular
GC will take it when needed.

Arne
 
Back
Top