Exemplo n.º 1
0
        private long calc_source_size()
        {
            ulong ret     = 0;
            var   f_count = 0;
            var   d_count = 0;
            var   data    = new WIN32_FIND_DATA();

            for (var i = 0; i < initial_source.Length; i++)
            {
                if (WinAPiFSwrapper.GetFileInfo(initial_source[i], ref data))
                {
                    if ((data.dwFileAttributes & FileAttributes.Directory) == FileAttributes.Directory)
                    {
                        ret += WinAPiFSwrapper.GetDirectoryStat
                                   (initial_source[i], true, false, true, ref f_count, ref d_count, null);
                    }
                    else
                    {
                        ret += data.FileSize;
                    }
                }
            }
            return((long)ret);
        }