Results 1 to 3 of 3

Thread: File Information

  1. #1
    Guest

    Question

    Help!

    I need to find a way to obtain a file name given the path to the file.

    For example if the path to the file is
    D:\blah\foo\bar\file.fff

    then i need to return "file.fff"
    I also need to be able to do this with URL's so
    http://blah/foo/bar/file.fff
    will also return "file.fff"

    Thanks!

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Shoud work with both
    Code:
    Function Filepart(filepath)
        For n = Len(filepath) To 1 Step -1
            If Mid(filepath, n, 1) = "\" Then Exit For
        Next n
        Filepart = Mid(filepath, n + 1)
    End Function
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Guest
    thanks for the help. i added a clause to handle the fact that url's use forward slash instead of backslash. otherwise it works perfectly.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width