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
6 * PROGRAMMER: Boudewijn ( ariadne@xs4all.nl)
12 #include <msvcrt/stdio.h>
13 #include <msvcrt/string.h>
14 #include <msvcrt/internal/file.h>
32 // should be replace by a closure of the tmp files
33 extern __file_rec *__file_rec_list;
38 loop files and check for name_to_remove
40 __file_rec *fr = __file_rec_list;
41 __file_rec **last_fr = &__file_rec_list;
47 /* Try to find an empty slot */
50 last_fr = &(fr->next);
52 /* If one of the existing slots is available, return it */
53 for (i=0; i<fr->count; i++) {
54 if (fr->files[i]->_name_to_remove != NULL) {
55 if ( _access(fr->files[i]->_name_to_remove,W_OK) ) {
56 strcpy(temp_name,fr->files[i]->_name_to_remove);
64 /* If this one is full, go to the next */
65 if (fr->count == __FILE_REC_MAX)
68 /* it isn't full, we can add to it */