User Tag List

Results 1 to 4 of 4

Thread: Getting a file's directory

  1. #1
    No Products Registered

    Join Date
    Aug 2006
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting a file's directory

    Hey, I need to get a directory from a file I drag 'n drop or double click (which my program opens). i.e. If I drag file "C:\my files\text.txt" how do I extract ONLY the "C:\my files\"?

    And of course this would be needed for ANY directory.

    thanks for any help given.

  2. #2
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting a file's directory

    You'll need to use string parser to find all the stuff upto and including the last "\"

    The MMF2 sytax is:[color:green]

    String Parser > Set source string = [/color][color:blue]Dropped$(>Enter number of file<)[/color][color:green]
    Result =[/color] [color:blue]leftstr$( "String Parser", lastSub( "String Parser", "\"))[/color]

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2006
    Posts
    271
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting a file's directory

    You could also use the File object:

    DriveName$( "File", Dropped$(>Enter number of file<))+DirectoryName$( "File", Dropped$(>Enter number of file<))

  4. #4
    No Products Registered

    Join Date
    Aug 2006
    Location
    Westcountry, UK
    Posts
    862
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting a file's directory

    lots of ways

Similar Threads

  1. file object won't copy? or create new directory?
    By Skeets in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 23rd June 2010, 10:37 PM
  2. Setting Directory with File Object
    By Renatos in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 26th April 2008, 12:24 AM
  3. Getting a file's directory
    By YAS in forum Extension Development
    Replies: 0
    Last Post: 21st October 2006, 09:12 PM

Posting Permissions

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