• Issue with { char in file name

    From alexandru@21:1/5 to All on Thu May 23 09:04:01 2024
    I just dicovered a new issue in my code, when a file name contains one
    open left curly bracket. Sure, a right bracket and other types of
    brakets will case same issue.

    For example, I have a file named "Test { .txt".

    My code takes specific file names (only the tails, no directory) and
    writes them to other files as strings.
    Due to automatic char escaping happening in this process, the string representing the file name will look like this: "Test\ \{\ 2.txt"

    Which is fine.

    Now my code will read those strings from the files and look them up, if
    they still exists on the drive.
    This is done by:

    set path [file join $dir $tail]
    set flag [file exists $path]

    where "tail" is the variable containing the file name and "dir" is the
    variable containing the directory whre the file is looked up.

    The result of the "file join" command is: "C:/test2/Test/ /{/ 2.mpasm"

    So all the excape chars are replaced by slash and I get the wrong file
    path.

    How can I avoid this issue?

    Many thanks
    Alexandru

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From alexandru@21:1/5 to All on Thu May 23 17:28:25 2024
    Thanks! You answers got me thinking.
    The issue was caused by writing data as a list, not as a string.
    Problem solved.
    Regards
    Alexandru

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)