# filemoddate in xetex

I compile the below file:

%my main file is named document .tex.
\documentclass{article}
\usepackage{graphicx,xcolor}
\usepackage{float}
\usepackage[crop=pdfcrop,process=all]{pstool}
\usepackage{xepersian}
\settextfont{Yas_4.ttf}
\begin{document}
سلام و درود بر شما
\begin{latin}
\begin{figure}[H]
\centering
\psfragfig*[width=0.6\linewidth]{02}{\color{blue}
\psfrag{TMP1}{5}%
\psfrag{TMP2}{$t$}
}
\end{figure}
\end{latin}
ادامه‌ی متن
\end{document}


With xelatex --shell-escape compile and this output:

And with this eror:

Package filemod Error: Required command \pdffilemoddate is not defined!. ...date\space is not defined!}{\filemod@help}
As you can see, the labels can not replacement properly.


But we know the pstool package use the catchfile,color,ifpdf,ifplatform,filemod,graphicx,psfrag,shellesc,suffix,trimspaces,xkeyval and expl3 packages too. At the begining of the filemod package .pdf we read: This package will work with LATEX and plain ε-TEX as long pdf(LA)TEX (in PDF or DVI mode) or Lua(LA)TEX is used. XETEX is not supported because it does not provide \pdffilemoddate. why? Who smells rat?:)) can this define the \pdffilemoddate command (or the same command) in xetex engine too? My eps file is here. Thanks.

Second edit about David's advice: I completely update my texlive. My above pstools error has been fixed. But my problem is still persist.
This is my log file and my font.
Compile With: xelatex --shell-escape %.tex
Editor: TeX studio

Third edit: With xelatex -shell-escape I have the below warning:

No file "02.tex" or "02-psfrag.tex" can be found that may contain macros for "02.eps".


My eps file name is 02.eps and I don't have 02.tex file or 02-psfrag.tex in my folder.
The above warning with pdflatex -shell-escape (without persian script and xepersian package) is existing too. But 02.pdf file at the below would add to my folder.

If I add the above file (02.pdf) to my folder, my xelatex's compile will have a correct output.
My question clearly is:
why with xelatex -shell-escape processing, 02.pdf not formed?
This is my log file dropbox link.

• @Fractal Thanks. May minimal code is above and i need to use \psfragfig command. Jan 1 '20 at 10:41
• @Fractal As Khaled Hosny's told, can you use \pdf@strcmp from pdftexcmds package, for handle engine differences on my minimal file? Jan 1 '20 at 11:00
• Sorry but I have no idea. Maybe a better user will answer this for you. Jan 1 '20 at 11:01
• @Fractal Thanks again. Jan 1 '20 at 11:02

\filemoddate was added to xetex in the 2019 release, so if you have an up to date system the example runs without error (although I tested with a different font and eps file).

It may be possible to avoid the use of filemod on older systems, but updating is probably easiest.

On older systems it probably works to define it to return a fixed date, so

\providecommand\pdffilemoddate[1]{D:20200101111927Z}


for example.

• Thanks a lot. let me update my texlive as soon as and test it. Jan 1 '20 at 12:01
• My problem is still persist. Please see me second edit. Thanks Jan 3 '20 at 10:15