SDC C-Project CF Review 프로그램
KEJ
2024-06-26 0c66940a8e2cf64c9890519901f433b3668216b6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "StdAfx.h"
#include "FolderMonitoring_08.h"
 
CFolderMonitoring_08::CFolderMonitoring_08( DWORD dwPeriod/*=50*/ )
{
 
}
 
CFolderMonitoring_08::~CFolderMonitoring_08( void )
{
 
}
 
BOOL CFolderMonitoring_08::PostProcessing( const VecString& vecFilePath, const SFolderMonitorParam& sMonitorParam )
{
    for (constVecStringIt it=vecFilePath.begin(); it!=vecFilePath.end(); it++)
    {
        // 0.8 Only 
        // Image Copy½Ã Full Image Á¦¿Ü.
        CString strSeparate =_T("");
        AfxExtractSubString(strSeparate,*it,1,_T('_'));
 
        if(strSeparate.CompareNoCase(_T("f")) == 0)
            continue;
 
        CString strExistFileName = sMonitorParam.strMonitorFolderPath + _T("\\") + *it;
 
        // 1. ÆÄÀÏ Å©±â°¡ º¯ÇÏ´ÂÁö È®ÀÎ
        BOOL bFind = FALSE;
        ULONGLONG nStartLength = -1;
        ULONGLONG nCurLength = 0;
        do 
        {
            CFileFind finder;
            BOOL bFind = finder.FindFile(strExistFileName);
            bFind = finder.FindNextFile();
            nCurLength = finder.GetLength();
            if ( (nStartLength!=-1) && ((nCurLength-nStartLength)==0) )
            {
                break;
            }
            nStartLength = nCurLength;
            ::Sleep(50);
        } while (TRUE);
 
        // 2. ÆÄÀÏÀ» ÈÄ󸮠ÇÔ.
        CString strNewFileName = sMonitorParam.strProcessFolderPath + _T("\\") + *it;
 
        switch(sMonitorParam.nProcessType)
        {
        case MonitorProcessType_Copy: // copy
            if (CopyFile(strExistFileName, strNewFileName, FALSE))
            {
                // º¹»ç½Ã¿¡´Â °á°ú ¹éÅÍ¿¡ ÆÄÀÏÀ̸§ ÀúÀåÇÔ. 
                SFolderMonitorResult result;
                result.strProcessFileName = *it;
                m_vecMonitorResult.push_back(result);
            }
            break;
 
        case MonitorProcessType_Move: // move
            if (MoveFile(strExistFileName, strNewFileName))
            {
 
            }
            break;
        }
 
        ::Sleep(10);
    }
 
    return TRUE;
}