Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2008
    Location
    The Netherlands
    Posts
    109

    found splitpath bug

    splitpath has a bug that renders it useless.

    if you have a folder with a .(dot) eg folder.restoffolder
    it will see that as the filename and the stuff after the dot as an extension
    because splitpath reads from left to right it will think that the first thing that has a dot is the filename and the stuff after it an extension and then stops because you can only have 1 filename

    so you will get this kind of situations

    C:\\dir\\folder.restfolder\\filename.doc

    splitpaths table will look like this

    drive = C:\\
    folder = dir
    filename = folder
    extension = restfolder

    and then stops

    IR please fix this with simply starting on the right.
    also see my other bug thread http://www.indigorose.com/forums/showthread.php?t=27600

  2. #2
    Join Date
    Apr 2005
    Location
    São Paulo, Brazil
    Posts
    2,539
    Thanks. This issue has been entered into the database with ref. number 18860.

    Ulrich

  3. #3
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Nice find, I never knew this lol. I'm writing a custom function now hehe (String.ReverseFind)

    Ulrich, could we get an optional startposition in String.ReverseFind? So we could repeat the search in a loop from a certain point?
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  4. #4
    Join Date
    Oct 2007
    Location
    Gensokyo
    Posts
    1,324
    Quote Originally Posted by Imagine Programming View Post
    Nice find, I never knew this lol. I'm writing a custom function now hehe (String.ReverseFind)

    Ulrich, could we get an optional startposition in String.ReverseFind? So we could repeat the search in a loop from a certain point?
    Cough String.Mid, cough.

  5. #5
    Join Date
    Apr 2007
    Location
    Raalte, OV, Netherlands
    Posts
    3,287
    Quote Originally Posted by ShadowUK View Post
    Cough String.Mid, cough.
    I was talking about a startposition in string.reversefind

    I know I could use string.mid, but I 'd like this.
    Bas Groothedde
    Imagine Programming :: Blog :: Familiar people here

    My AMS Plugins:

  6. #6
    Join Date
    Jun 2000
    Location
    Indigo Rose Software
    Posts
    1,943
    Hi Limbo,

    What version of AutoPlay are you using? Also what does your code look like? I've tried to replicate this using the following code but it works for me:

    Code:
    Debug.ShowWindow(true);     --Shows the debug window.
    path_parts = String.SplitPath("C:\\dir\\folder.restfolder\\filename.doc");
    Debug.Print("Drive: "..path_parts.Drive.."\r\n");
    Debug.Print("Folder: "..path_parts.Folder.."\r\n");
    Debug.Print("Filename: "..path_parts.Filename.."\r\n");
    Debug.Print("Extension: "..path_parts.Extension.."\r\n");
    The results are what I would expect:

    Code:
    Drive: C:
    Folder: \dir\folder.restfolder\
    Filename: filename
    Extension: .doc
    Is anyone else getting different results?

    mark.
    MSI Factory The Next Generation Intelligent Setup Builder

  7. #7
    Join Date
    May 2006
    Posts
    5,380
    The results are what I would expect:
    yup, me to

    Drive: C:
    Folder: \dir\folder.restfolder\
    Filename: filename
    Extension: .doc
    even with some extreme dot notation it works as expected, there's no bug here

    Code:
    Debug.ShowWindow(true);     --Shows the debug window.
    path_parts = String.SplitPath("C:\\base.dir\\folder.rest.folder\\file.name.doc");
    Debug.Print("Drive: "..path_parts.Drive.."\r\n");
    Debug.Print("Folder: "..path_parts.Folder.."\r\n");
    Debug.Print("Filename: "..path_parts.Filename.."\r\n");
    Debug.Print("Extension: "..path_parts.Extension.."\r\n");
    outputs

    Drive: C:
    Folder: \base.dir\folder.rest.folder\
    Filename: file.name
    Extension: .doc
    Open your eyes to Narcissism, Don't let her destroy your life!!

Posting Permissions

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