Re: vb

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Bob Butler (tiredofit_at_nospam.com)
Date: 04/04/04


Date: Sun, 4 Apr 2004 08:51:38 -0700


"Chris Barber" <chris@blue-canoe.co.uk.NOSPAM> wrote in message
news:O6MXlklGEHA.3940@tk2msftngp13.phx.gbl
> I'm sorry, did I offend you somehow?

No, it's just that the FSO has been discussed at length in the newsgroups
many times

> It was merely a suggestion and seems to be the primary method of file
> system manipulation in Visual Basic and VBScript.

Actually, I'd list it as tertiary. VB has it's own file I/O statements and
the Windows API offers a lot of options for what VB does not handle easily.
FSO is *way* down the list.

> I can't see the difficulty in creating a filesystem tree using this
> method (aside from the fact that it's dog slow).

Well, there's one major reason why FSO should be avoided. It is extremely
slow. It also adds a lot of overhead to your app, requires another DLL that
may or may not be on most user's systems, exists in several
not-quite-compatible versions and is often disabled/deleted by system admins
because it's a favorite tool of hackers.

> Actually, I use API calls to do file system in VB but that's only
> because I have a wrapper, it's about a gazillion times faster, and
> don't want the pain of distributing the WScript runtimes.

VB's Dir function, with a little coding, can do the recursive search just
fine. The API calls are easier in some respectes because they can be used
recursively without a lot of additional code. Either approach is much
better than the FSO.



Relevant Pages

  • API vs. FSO
    ... Would some of you please explain why you prefer the Windows API ... drives/directories/files functions to the FSO and its associated objects? ... VBA Automation/VB/C++/Web and DB development ...
    (microsoft.public.vb.general.discussion)
  • Re: "scrrun.dll" not compatible in different languages?
    ... > implement in VB 6 without FSO or another file system interface. ... I spent a couple of days and wrote an FSO replacement using native VB6 File I/O and the Windows API. ...
    (microsoft.public.vb.general.discussion)
  • Re: API vs. FSO
    ... > Would some of you please explain why you prefer the Windows API ... FSO is slow, adds overhead, requires and external DLL, and is sometimes ... numerous samples exist. ...
    (microsoft.public.vb.general.discussion)
  • Re: vb
    ... it's just that the FSO has been discussed at length in the newsgroups ... the Windows API offers a lot of options for what VB does not handle easily. ... > method (aside from the fact that it's dog slow). ... VB's Dir function, with a little coding, can do the recursive search just ...
    (microsoft.public.vb.database)
  • Re: Print Directories
    ... the FSO is a waste of space and you don't need to repeat the ... it's just a wrapper for the same APIs anyway. ... >> Minimal Code for a Recursive Search for Folders ...
    (microsoft.public.vb.general.discussion)