Tikal errir with input file that is quoted and has a wildard.

Create issue
Issue #1038 new
Former user created an issue

This error does not happen when you use quotes but not wildcard, and wildcard but not quotes.

tikal.bat -xm "D:\websites*.html" -sl ja-jp -ie utf-8 -trace

Okapi Tikal - Localization Toolset Version: 2.1.41.0


Trace: 1 class net.sf.okapi.applications.tikal.Main Trace: 2 ProtectionDomain (file:/C:/Users/user/Downloads/okapi-apps_win32-x86_64_1.41.0/lib/okapi-application-tikal-1.41.0.jar <no signer certificates>) sun.misc.Launcher$AppClassLoader@30f39991 <no principals> java.security.Permissions@5c645b43 ( ("java.io.FilePermission" "\C:\Users\user\Downloads\okapi-apps_win32-x86_64_1.41.0\lib\okapi-application-tikal-1.41.0.jar" "read") ("java.lang.RuntimePermission" "exitVM") )

Trace: 3 (file:/C:/Users/user/Downloads/okapi-apps_win32-x86_64_1.41.0/lib/okapi-application-tikal-1.41.0.jar <no signer certificates>) Trace: 4 file:/C:/Users/user/Downloads/okapi-apps_win32-x86_64_1.41.0/lib/okapi-application-tikal-1.41.0.jar Trace: 5 /C:/Users/user/Downloads/okapi-apps_win32-x86_64_1.41.0/lib/okapi-application-tikal-1.41.0.jar Extraction to Moses InlineText net.sf.okapi.common.exceptions.OkapiException: Error while trying to guess language information. D:\websites*.html (�ļ�����Ŀ¼�������﷨����ȷ��) at net.sf.okapi.common.FileUtil.guessLanguages(FileUtil.java:149) at net.sf.okapi.applications.tikal.Main.guessMissingLocales(Main.java:849) at net.sf.okapi.applications.tikal.Main.process(Main.java:1013) at net.sf.okapi.applications.tikal.Main.main(Main.java:604)

Comments (2)

  1. Wei JIANG

    I am the original anonymous poster, and I use Windows 10. For your further infomation:

    1. when I specify a non-existing file explicitly - ie, without any wildcard -, either with or without quotes, I get the same error, ie, system could not find the specified file.
    2. when I specify a non-existing file with a wildcard that matches no file, either with or without quotes, I get the same error as in the original post, ie: file name, directory or volumn syntax is incorrect.
    3. when I specify an existing file with mixed styles of slashes and back-slashes, either with our without quotes, it can be processed properly. (If you “dir” that file, you would get an error. In light of this, my best guess is that, the wildcard expansion in the Tikal command IS NOT done by Windows shell.

  2. Kuro Kurosaka (BH Lab)

    I took a brief look at this and I think Wei is right that Windows cmd doesn’t expand the wildcard before passing to each command. It’s up to the command to interpret the wildcard pattern.
    Currently, tikal.bat is just passing all parameters as %*. So “tikal -x abc*.txt” will invoke the Java class net.sf.okapi.applications.tikal.Main sees “-x” and “abc*.txt” as its parameters.

    The DOS FOR loop can be used to let CMD to take care of expanding the wildcard like this:

    set filearg="%*"
    for %%i in (%filearg%) do (
        echo %%i
    )
    

    If we can find a way to construct a variable that holds a list of arguments and a way to pass that variable to the Java Main, this can be solved without adding extra Windows-only logic to the Java program. Unfortunately I couldn’t find such a formula.

  3. Log in to comment