I'm trying to read some data from a file and use the following approach:
\documentclass{minimal}
\newcommand{\file}{./.dir/.testFile}
\begin{document}
\newread\myread
\openin\myread=\file\relax
\loop
\read\myread to \data
\unless\ifeof\myread
\data
\repeat
\closein\myread
\end{document}
This works for the following files (specified in the \file macro):
testFile.txt--> Normal filedir/testFile.txt--> Normal file in folder.dir/testFile.txt--> Normal file in hidden folder.dir/.testFile--> Hidden file in hidden folder
But exactly the case which I need is not working: .dir/testFile. Why is it not possible to read a file without file extension and is there a way to get around this? Renaming the file is no option for me as the file is used/modified/created by another application. I need just the first line of the file, if this simplifies the problem in any way.
According to this question/answer, the extension .tex is always appended to the file name if no extension is given (even by using low-level commands). But I still think there must be a way to bypass this.
System:
- pdfTeX, Version 3.1415926-2.4.1.40.13
- MiKTeX 2.9 (Revision 2.9.4533, 32 bit)
- Windows 7 Professional (64 bit)
/tmp/.dir, move there file.testFilewith some text and move your latex file into\tmp. It compiles. Maybe your problem is with access to that file? – Eddy_Em Aug 15 '13 at 07:17testFile(no extension, not hidden). This is the case which is not working. – jrast Aug 15 '13 at 07:23\data=prompt when the file does not have an extension whether the folder starts with.or not. This is definitely in contrast to TeX Live, but I guess might be a 'system-dependent variation'. Only Christian Schenk can say if it's deliberate. – Joseph Wright Aug 15 '13 at 10:03