469,608 Members | 2,632 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,608 developers. It's quick & easy.

Reusing FileSystemObject Object

Hi all,

If I create a FileSystemObject Object is it appropriate to reuse it to
perform operations on different files/folders?

Or should I create a new FileSystemObject Object for each file and folder?

--
Sean.
Oct 12 '05 #1
2 1953
Sean S - Perth, WA wrote:
Hi all,

If I create a FileSystemObject Object is it appropriate to reuse it to
perform operations on different files/folders?

Sure. Try it.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Oct 12 '05 #2
<Sean S - Perth>; "WA" <Se**********@discussions.microsoft.com> wrote in
message news:43**********************************@microsof t.com...
If I create a FileSystemObject Object is it appropriate to reuse it to
perform operations on different files/folders?


Yes, absolutely.

In fact, I took it as far as creating a function that returns me an
instantiated FileSystemObject, rather than creating it myself in all
the odd little functions I might want to use it, as in

Dim g_oFSO ' as FileSystemObject
Set g_oFSO = Nothing

Function FSO() ' as FileSystemObject
If g_oFSO Is Nothing Then
Set g_oFSO = CreateObject( "Scripting.FileSystemObject" )
End If
Set FSO = g_oFSO
End If

HTH,
Phill W.
Oct 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marcelo Rizzo | last post: by
5 posts views Thread by John Dewbert | last post: by
9 posts views Thread by Alan | last post: by
7 posts views Thread by Klaus Johannes Rusch | last post: by
2 posts views Thread by bteclt | last post: by
1 post views Thread by G Gerard | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.