Open each file in a directory and check corrupted files

Discussion in 'MFC' started by Member12, Jul 8, 2010.

  1. Member12

    Member12 New Member

    Joined:
    Jul 8, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi...

    I have a directory which contains all types of files(.doc,.xls,.pdf,.txt,.msg,.xml,.html etc...) and the number files increases day by day. Some files might have been corrupted in the directory and they will not open whenever i try to open. It just shows an error message saying file cannot be opened.

    Now i need to write a program to open each file in the directory and close it. Whenever a file doesn't opens, i need to take the file name and store it in a log file or a stack. At the end of the day i will have the file names which are corrupted.

    I am able to open the files but could not close them. Please help me how do i close each file and take the files names which did not open....
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice