2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/msvcrt/stdio/rmtmp.c
5 * PURPOSE: remove temporary files in current directory
13 // should be replace by a closure of the tmp files
14 extern __file_rec
*__file_rec_list
;
19 loop files and check for _tmpfname
21 __file_rec
*fr
= __file_rec_list
;
22 __file_rec
**last_fr
= &__file_rec_list
;
28 /* Try to find an empty slot */
31 last_fr
= &(fr
->next
);
33 /* If one of the existing slots is available, return it */
34 for (i
=0; i
<fr
->count
; i
++) {
35 if (fr
->files
[i
]->_tmpfname
!= NULL
) {
36 if ( _access(fr
->files
[i
]->_tmpfname
,W_OK
) ) {
37 strcpy(temp_name
,fr
->files
[i
]->_tmpfname
);
45 /* If this one is full, go to the next */
46 if (fr
->count
== __FILE_REC_MAX
)
49 /* it isn't full, we can add to it */