You are here: Home » Topic » ?’s in file names.

?’s in file names.

This topic contains 2 replies, has 2 voices, and was last updated by  rpedde 9 years, 10 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2003

    Anonymous

    I have a number of mp3 files with ?’s in the file names. Firefly (nightly 1696 ) fails when trying to scan them.

    It looks like the problem is that the filenames are being turned into file:// urls without url encoding. The ? is then interpreted as the beginning of a parameter string by io_open().

    Possible fixes:

    – The scan_* utilities should url encode the file names before turning them into file:// urls. io_file_open() would need to urldecode the filename to get the actual file name back before attempting to open() the file.

    – It’s not clear to me that that io_open should attempt to look for parameters for the file:// protocol. What is actually supposed to interpret the parameters? It might be simpler than encoding/decoding and hoping you get the same file name to just bypass the rest of the parsing for file://

    Thoughts?

    Thanks,
    –Rob

    #14999

    Anonymous

    I’m replying to my own post. Ok, I see how io_file_open() is using parameters, so ignore what I listed as the 2nd possible fix.

    However I noticed that io_open() is calling io_urldecode *before* searching for the ? query separator. I think that’s a bug, it should search for the ? first and then url decode.

    So i think the first fix is probably the right one, everything that takes a local file name and turns it into a file:// url needs to url encode before calling io_open().

    Thanks,
    –Rob

    #15000

    rpedde
    Participant

    @rct wrote:

    I’m replying to my own post. Ok, I see how io_file_open() is using parameters, so ignore what I listed as the 2nd possible fix.

    However I noticed that io_open() is calling io_urldecode *before* searching for the ? query separator. I think that’s a bug, it should search for the ? first and then url decode.

    So i think the first fix is probably the right one, everything that takes a local file name and turns it into a file:// url needs to url encode before calling io_open().

    Thanks,
    –Rob

    Ah, yes. Exactly. Nice catch.

    — Ron

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.