dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 2 of 4 FirstFirst 1234 LastLast
Results 16 to 30 of 55

Thread: Determining a file extension

  1. #16
    Michael Shutt Guest

    Re: Determining a file extension

    The other suggestions will work, but you may want to check out the
    Scripting.FileSystemObject also. Add a reference to "Microsoft Scripting
    Runtime" to your project. The file system object has a handful of functions
    for extracting parts of a path or constructing a full path based on the
    parts.

    --
    Michael Shutt

    Please respond to newsgroup as I will not return direct emails.

    "Mike Kraemer" <mkraemer@91expresslanes.com> wrote in message
    news:3b61d8a5$1@news.devx.com...
    >
    > Hi Everyone!
    > I'm building a routine that builds the path to image files that are

    retreive
    > for user reviews. The files may be either file.jpg or file.tif. Any

    recomendations
    > as to which call if any to use?
    > Thanks in advance for your assistance.
    >
    > Mike




  2. #17
    Michael Shutt Guest

    Re: Determining a file extension

    The other suggestions will work, but you may want to check out the
    Scripting.FileSystemObject also. Add a reference to "Microsoft Scripting
    Runtime" to your project. The file system object has a handful of functions
    for extracting parts of a path or constructing a full path based on the
    parts.

    --
    Michael Shutt

    Please respond to newsgroup as I will not return direct emails.

    "Mike Kraemer" <mkraemer@91expresslanes.com> wrote in message
    news:3b61d8a5$1@news.devx.com...
    >
    > Hi Everyone!
    > I'm building a routine that builds the path to image files that are

    retreive
    > for user reviews. The files may be either file.jpg or file.tif. Any

    recomendations
    > as to which call if any to use?
    > Thanks in advance for your assistance.
    >
    > Mike




  3. #18
    Karl E. Peterson Guest

    Re: Determining a file extension

    Hi Rob --

    > I know what you mean, but these days the only 95 systems that don't have IE4.0
    > are either a brand new pre OSR2 install (right before IE4+ gets installed),
    > or an alternate boot for a Linux box.


    Or, your mom's. Or, worse, your wife's mom's. ;-)

    I agreed the incidence is low, but I guess I still hold that *if* it's doable,
    especially with ease, in "pure VB", using these hit-and-miss DLLs isn't as
    responsible in non-controlled distributions.

    Later... Karl
    --
    http://www.mvps.org/vb



  4. #19
    Karl E. Peterson Guest

    Re: Determining a file extension

    Hi Rob --

    > I know what you mean, but these days the only 95 systems that don't have IE4.0
    > are either a brand new pre OSR2 install (right before IE4+ gets installed),
    > or an alternate boot for a Linux box.


    Or, your mom's. Or, worse, your wife's mom's. ;-)

    I agreed the incidence is low, but I guess I still hold that *if* it's doable,
    especially with ease, in "pure VB", using these hit-and-miss DLLs isn't as
    responsible in non-controlled distributions.

    Later... Karl
    --
    http://www.mvps.org/vb



  5. #20
    Karl E. Peterson Guest

    Re: Determining a file extension

    Hi L.J. --

    > > Heh, I got *stung* so bad on that DLL many years ago, that I've sworn off

    > it.
    >
    > And it's *much* slower (at least according to the benchmarks on VBNet, which
    > I duplicated in magnitude on my machine).


    Wow, that right? Further ammo for doing it the Classic way.

    > Fortunately, *most* of the time it doesn't matter, unless you are iterating
    > thru a LOT of files.


    Could be all that pointless conversion from->to->from Unicode, huh?

    Thanks... Karl
    --
    http://www.mvps.org/vb



  6. #21
    Karl E. Peterson Guest

    Re: Determining a file extension

    Hi L.J. --

    > > Heh, I got *stung* so bad on that DLL many years ago, that I've sworn off

    > it.
    >
    > And it's *much* slower (at least according to the benchmarks on VBNet, which
    > I duplicated in magnitude on my machine).


    Wow, that right? Further ammo for doing it the Classic way.

    > Fortunately, *most* of the time it doesn't matter, unless you are iterating
    > thru a LOT of files.


    Could be all that pointless conversion from->to->from Unicode, huh?

    Thanks... Karl
    --
    http://www.mvps.org/vb



  7. #22
    Karl E. Peterson Guest

    Re: Determining a file extension

    And that's probably the slowest of all possible methods...
    --
    http://www.mvps.org/vb

    "Michael Shutt" <mshutt_nospam@mediaone.net> wrote in message
    news:3b668a41@news.devx.com...
    > The other suggestions will work, but you may want to check out the
    > Scripting.FileSystemObject also. Add a reference to "Microsoft Scripting
    > Runtime" to your project. The file system object has a handful of functions
    > for extracting parts of a path or constructing a full path based on the
    > parts.
    >
    > --
    > Michael Shutt
    >
    > Please respond to newsgroup as I will not return direct emails.
    >
    > "Mike Kraemer" <mkraemer@91expresslanes.com> wrote in message
    > news:3b61d8a5$1@news.devx.com...
    > >
    > > Hi Everyone!
    > > I'm building a routine that builds the path to image files that are

    > retreive
    > > for user reviews. The files may be either file.jpg or file.tif. Any

    > recomendations
    > > as to which call if any to use?
    > > Thanks in advance for your assistance.
    > >
    > > Mike

    >
    >



  8. #23
    Karl E. Peterson Guest

    Re: Determining a file extension

    And that's probably the slowest of all possible methods...
    --
    http://www.mvps.org/vb

    "Michael Shutt" <mshutt_nospam@mediaone.net> wrote in message
    news:3b668a41@news.devx.com...
    > The other suggestions will work, but you may want to check out the
    > Scripting.FileSystemObject also. Add a reference to "Microsoft Scripting
    > Runtime" to your project. The file system object has a handful of functions
    > for extracting parts of a path or constructing a full path based on the
    > parts.
    >
    > --
    > Michael Shutt
    >
    > Please respond to newsgroup as I will not return direct emails.
    >
    > "Mike Kraemer" <mkraemer@91expresslanes.com> wrote in message
    > news:3b61d8a5$1@news.devx.com...
    > >
    > > Hi Everyone!
    > > I'm building a routine that builds the path to image files that are

    > retreive
    > > for user reviews. The files may be either file.jpg or file.tif. Any

    > recomendations
    > > as to which call if any to use?
    > > Thanks in advance for your assistance.
    > >
    > > Mike

    >
    >



  9. #24
    L.J. Johnson Guest

    Re: Determining a file extension

    Karl,

    > And that's probably the slowest of all possible methods...


    Yes, but let's be fair <g>. At least in the programs I've worked on, *most*
    of the times I work with somewhere between a couple of files, and a couple
    of dozen. You'd never see the speed difference here. It *does*, of course,
    require an additional DLL, but some of the routine are darn handy.

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>





  10. #25
    L.J. Johnson Guest

    Re: Determining a file extension

    Karl,

    > And that's probably the slowest of all possible methods...


    Yes, but let's be fair <g>. At least in the programs I've worked on, *most*
    of the times I work with somewhere between a couple of files, and a couple
    of dozen. You'd never see the speed difference here. It *does*, of course,
    require an additional DLL, but some of the routine are darn handy.

    --
    L.J. Johnson, Slightly Tilted Software
    Microsoft MVP (Visual Basic)
    LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    <http://www.SlightlyTiltedSoftware.com>
    Ask The NT Pro at <http://www.devx.com/gethelp>





  11. #26
    Karl E. Peterson Guest

    Re: Determining a file extension

    Hi L.J. --

    > > And that's probably the slowest of all possible methods...

    >
    > Yes, but let's be fair <g>. At least in the programs I've worked on, *most*
    > of the times I work with somewhere between a couple of files, and a couple
    > of dozen. You'd never see the speed difference here. It *does*, of course,
    > require an additional DLL, but some of the routine are darn handy.


    Depends what you're up to. In most simple cases, that's very true. The problems
    occur when folks write these as "generic" routines, then try to scale them to the
    trouble cases. The bottom line is, there can easily be *two orders* of magnitude
    difference, based on the choices made:

    http://www.mvps.org/vbnet/code/filea...apicompare.htm

    Might as well just invest the time to do it right the first time, then reap the
    benefits from there on out.

    Later... Karl
    --
    http://www.mvps.org/vb



  12. #27
    Karl E. Peterson Guest

    Re: Determining a file extension

    Hi L.J. --

    > > And that's probably the slowest of all possible methods...

    >
    > Yes, but let's be fair <g>. At least in the programs I've worked on, *most*
    > of the times I work with somewhere between a couple of files, and a couple
    > of dozen. You'd never see the speed difference here. It *does*, of course,
    > require an additional DLL, but some of the routine are darn handy.


    Depends what you're up to. In most simple cases, that's very true. The problems
    occur when folks write these as "generic" routines, then try to scale them to the
    trouble cases. The bottom line is, there can easily be *two orders* of magnitude
    difference, based on the choices made:

    http://www.mvps.org/vbnet/code/filea...apicompare.htm

    Might as well just invest the time to do it right the first time, then reap the
    benefits from there on out.

    Later... Karl
    --
    http://www.mvps.org/vb



  13. #28
    Rob Teixeira Guest

    Re: Determining a file extension



    Hey! Scaling out...
    Careful Karl, that almost sounds like pro-.NET logic! What about the "little
    guy" with his "real" VB app? <g>

    -Rob

    "Karl E. Peterson" <karl@mvps.org> wrote:
    >
    >Depends what you're up to. In most simple cases, that's very true. The

    problems
    >occur when folks write these as "generic" routines, then try to scale them

    to the
    >trouble cases. The bottom line is, there can easily be *two orders* of

    magnitude
    >difference, based on the choices made:
    >
    > http://www.mvps.org/vbnet/code/filea...apicompare.htm
    >
    >Might as well just invest the time to do it right the first time, then reap

    the
    >benefits from there on out.
    >
    >Later... Karl
    >--
    >http://www.mvps.org/vb
    >
    >



  14. #29
    Rob Teixeira Guest

    Re: Determining a file extension



    Hey! Scaling out...
    Careful Karl, that almost sounds like pro-.NET logic! What about the "little
    guy" with his "real" VB app? <g>

    -Rob

    "Karl E. Peterson" <karl@mvps.org> wrote:
    >
    >Depends what you're up to. In most simple cases, that's very true. The

    problems
    >occur when folks write these as "generic" routines, then try to scale them

    to the
    >trouble cases. The bottom line is, there can easily be *two orders* of

    magnitude
    >difference, based on the choices made:
    >
    > http://www.mvps.org/vbnet/code/filea...apicompare.htm
    >
    >Might as well just invest the time to do it right the first time, then reap

    the
    >benefits from there on out.
    >
    >Later... Karl
    >--
    >http://www.mvps.org/vb
    >
    >



  15. #30
    Rob Teixeira Guest

    Re: Determining a file extension


    Ouch! That's like 80 function or so. You're going to need a whole magazine
    for that article

    Still, I'd be interested in seeing a good utility library, since there are
    some things I would have liked to see in shlwapi that aren't there.

    -Rob

    "L.J. Johnson" <LJJohnson@SlightlyTiltedSoftware.com> wrote:
    >I have mixed feelings, but I've used them before <shame>.
    >
    >Might be interesting to wrapper *all* the functions in VB/API code as an
    >stand-alone dll (which would be faster, to boot). Think it's worth wasting
    >an article on?
    >
    >--
    >L.J. Johnson, Slightly Tilted Software
    >Microsoft MVP (Visual Basic)
    >LJJohnson@SlightlyTiltedSoftware.com or LJJohnson@mvps.org
    ><http://www.SlightlyTiltedSoftware.com>
    >Ask The NT Pro at <http://www.devx.com/gethelp>
    >
    >
    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center