// include issue with script file names containing round brackets

// include issue with script file names containing round brackets

18
Basic UserBasic User
18

    Oct 14, 2011#1

    A couple of days ago, I renamed my scripts to group them together better. For instance:

    x_aarp_(cult_like_sites).js
    x_aarp_(john_q_public).js

    I found out that UltraEdit doesn't like the parenthesis, or even the square brackets in the file names, despite they are "legal" in Windows file names. I tried to escape the parenthesis with the backslash, and that didn't work.

    IMHO this is a bug. The scripts can't handle "legal" file names.

    6,675585
    Grand MasterGrand Master
    6,675585

      Oct 15, 2011#2

      Round brackets are allowed in file names, but should not be used because causing troubles like this or in batch files. Round brackets are used on function calls in all script languages and therefore it is not good to use round brackets for file names.

      Square brackets are even more problematic. FAT file system does not allow the usage of [ and ] in file name, see Microsoft support article Overview of FAT, HPFS, and NTFS File Systems.

      That's probably the reason why Norton Commander for many, many years displayed directories as [directory name] and why Windows file managers with the GUI like Norton Commander for DOS still use square brackets to emphasize directory names.

      Also Microsoft defined [section name] for INI and INF files as there was just FAT and DOS/Windows 16-bit, perhaps also because square brackets were not allowed in file names. Therefore it could not result in a problem when a file name is used as section name in an INI file.

      Often round brackets appended to a file name are used as line number information on error and warning messages. The parenthesis are in this case interpreted as delimiter character to separate a string into file name and line number.

      Why the include of a script file with round or square brackets is not working must be asked IDM. Perhaps the IDM developers have excluded explicitly them to avoid interpreting a script function within a line comment by mistake as file to include.

      I suggest to use 2 or 3 underscores as separator and don't use round and square brackets in file names.

      18
      Basic UserBasic User
      18

        Oct 18, 2011#3

        Thanks. I made modifications necessary.