[fpc-pascal] GetTempFileName in Linux

Sven Barth pascaldragon at googlemail.com
Tue Oct 5 17:30:15 CEST 2010


Am 05.10.2010 17:20, schrieb Leonardo M. Ramé:
> Hi, if I run this program from command line in Linux, I allways get the same result, "/tmp/TMP00000.tmp". Shouldn't it return a different file name each time it's executed?.
>
> How can I get different file names?
>
> program tempfilename;
> uses
>    sysutils;
> begin
>    writeln(GetTempFileName);
> end.

Did you delete the file after the run of your program? GetTempFileName 
always starts from 0 and checks whether that file already exists. If 
not, it returns that name else it continues increasing the index.

Regards,
Sven



More information about the fpc-pascal mailing list