Maurice Lombardi wrote:
- intfiledemo.pas does not work. Cannot rewrite a non assigned file under djgpp
This should work (works for me in DosEmu). Does GetTempFileName return a valid name?
program Foo;
uses GPC;
begin Writeln (GetTempFileName); Writeln (GetTempDirectory); CheckInOutRes end.
c:\djgpp\tmp\GPaaa13491 c:\djgpp\tmp\
This directory exists. With LFN=y a 10 chars filename should work as expected.
Hope this helps
Just to be sure, does the following program work? program foo; var f : Text; s : String (4096); begin Rewrite (f, 'c:\djgpp\tmp\GPaaa13491'); Writeln (f, 'OK'); Reset (f); Readln (f, s); Writeln (s) end. If this works, could you please try inserting the following line: fprintf (stderr, "internal file name: %s\n", filename); into rts/file.c after the line: filename = _p_nameit (File, mode); rebuild the RTS and compile and run the following test program: program Foo; var f : Text; begin Rewrite (f); end. It should write `internal file name: (null)' 3 times -- that's ok (for Input, Output and StdErr), and then the temp name which should be a valid, but non-existing file name. If this still works, you might want to make sure it really isn't a LFN problem. You could change rts/filename.pas, function GetTempFileName, so it return a name not longer than 8+3 (e.g., just return a constant name for testing), and rebuild the RTS. If the problem still exists then, it's no LFN problem... Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/ GPC To-Do list, latest features, fixed bugs: http://agnes.dida.physik.uni-essen.de/~gnu-pascal/todo.html