DeleteFile 
Author Message
 DeleteFile

does anyone know if you can use wildcards with deletefile
i have the expression below which does not seem to work.

     swprintf (delete_log_filename,
        _T("%s%04d%02d*.csv"),
        LOGGING_DIRECTORY,
        systime.wYear,
        (systime.wMonth-1)
        );

     success = DeleteFile(delete_log_filename);



Mon, 19 Sep 2005 16:30:12 GMT  
 DeleteFile

DeleteFile doesn't recognize wildcards. But FindFirstFile/FindNextFile do.
So use them to enumerate the files you need to delete and call DeleteFile
for each file separately.

--
Sincerely,
Alexander


http://www.RSDN.ru - Russian Software Developer Network


Quote:
> does anyone know if you can use wildcards with deletefile
> i have the expression below which does not seem to work.

>      swprintf (delete_log_filename,
>         _T("%s%04d%02d*.csv"),
>         LOGGING_DIRECTORY,
>         systime.wYear,
>         (systime.wMonth-1)
>         );

>      success = DeleteFile(delete_log_filename);



Mon, 19 Sep 2005 16:38:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Winword problem w/ a DeleteFile call after a Navigate call

2. DeleteFile

3. global DeleteFile

4. DeleteFile() returns ACCESS_DENIED?

5. deletefiles in a Multithreaded application

6. Closehandle/DeleteFile problem

7. DeleteFile does not work

8. DeleteFile() Question

9. Cannot use deletefile() function with SHARING_VIOLATION

10. DeleteFile Problem

11. DeleteFile; should it work for the directory?

 

 
Powered by phpBB® Forum Software