Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MiKTeX failed to test file existence for /dev/null, on macOS and Linux #264

Closed
1 task done
Liam0205 opened this issue Feb 13, 2019 · 2 comments
Closed
1 task done
Assignees
Milestone

Comments

@Liam0205
Copy link

As mentioned by @fylimas in #77 (comment), MiKTeX failed to test OS on macOS and Linux. The origin of the problem rooted in the failure of a file existence test: /dev/null.

Both CTeX (CTeX-org/ctex-kit#340 and CTeX-org/ctex-kit#313) and ifplatform consider Windows if /dev/null doesn't exist. However, MiKTeX always gives False by the following test, on macOS and Linux, which cause problems:

\ExplSyntaxOn
\file_if_exist:nTF { /dev/null } { True } { False }
\ExplSyntaxOff

Please consider to check and fix it. Thanks!


MWE:

% macOS High Sierra 10.13
% MiKTeX 2.9.6637
% CTeX 2.4.14
% xelatex --shell-escape mwe.tex
\documentclass{article}
\usepackage{ifplatform}
\usepackage[fontset=none]{ctex}

\begin{document}

ifplatform test:\\
\ifshellescape shell escape on\else shell escape off\fi\\
\IfFileExists{/dev/null}{dev null exists}{dev null not exists}\\
\ifwindows windows true \else windows false \fi

\ExplSyntaxOn
\LaTeX3 ~ test: \\
\file_if_exist:nTF { /dev/null } { dev ~ null ~ exists } { dev ~ null ~ not ~ exists } \\
\file_if_exist:nTF { /Library/Fonts/Songti.ttc } { Library ~ Fonts ~ Songti ~ exists } { Library ~ Fonts ~ Songti  ~ not ~ exists } \\
\ctex_detected_platform:
g_ctex_fontset_tl: ~ \g__ctex_fontset_tl \\
\ExplSyntaxOff

\end{document}

Result:

ifplatform test:
shell escape on
dev null not exists
windows true
LATEX3 test:
dev null not exists
Library Fonts Songti exists
g_ctex_fontset_tl: windows

@Liam0205
Copy link
Author

Liam0205 commented Feb 13, 2019

c.c. @leo-liu @qinglee @WenboSheng

@edocevoli edocevoli self-assigned this Feb 14, 2019
@edocevoli edocevoli added this to the 2.9.7000 milestone Feb 14, 2019
edocevoli added a commit that referenced this issue Mar 4, 2019
@edocevoli edocevoli added invalid and removed invalid labels Apr 14, 2019
@edocevoli
Copy link
Member

Thank you for the report. This has been fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants