亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ccmprs.cpp

?? A command-line file compression utility for Windows NT. It allows you to select files for NTFS fil
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
//**************************************************************************
//
//  CCMPRS -- Conditional File Compression Utility for Windows NT
//
//  Written by Robert Epps
//
//  This program and its source are in the public domain.  If you find any
//  bugs, or add features to this program, I'd like to hear about them!
//  Please write to me at:
//
//  Internet:  robepps@valleynet.com
//  CIS:       72560,3353
//  AOL:       RobertE49
//
//**************************************************************************
#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winioctl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>


//**************************************************************************
// Global variables representing the various options.
//**************************************************************************
char   szFileSpec[_MAX_PATH];       // Path and filename of file(s) to examine
BOOL   bRecurse    = FALSE;         // TRUE = recurse into subdirectories
BOOL   bDecompress = FALSE;         // TRUE = do decompression
BOOL   bQuiet      = FALSE;         // TRUE = don't display any status info
double threshold   = 0.75;          // Allow compression if (compressed size) <= (uncompressed size) * threshold
double MinFileSize = 0;             // Minimum uncompressed size for file to be compressed

char *szIgnoreExts;                 // Points to string containing extensions of files to ignore (command-delimited)
char *szExts;                       // Points to copy of above string, used for strtok() parsing

UINT nCompressed;                   // # of files compressed
UINT nDecompressed;                 // # of files decompressed
double sizechange;                  // Total size change after files compressed/decompressed

char szTemp[_MAX_PATH];


//**************************************************************************
//  Routine to display helpful instructions.
//**************************************************************************
void DisplayUsage(void)
{
    printf("CCMPRS -- Conditional File Compression/Decompression Utility\n\n");
    printf("Command line format is:\n\n");
    printf("  ccmprs filespec [options]\n\n");
    printf("where filespec is the path and filename (wildcards allowed) of the\n");
    printf("file(s) to be examined.  The options are:\n\n");
    printf("  -s  : Examine files in subdirectories as well as the specified directory.\n");
    printf("  -d  : Decompress any compressed files encountered that do not meet the\n");
    printf("        specified conditions for compression.\n");
    printf("  -t# : Compress file only if resulting file size is # percent or less of\n");
    printf("        the uncompressed size.  If this option is not specified, the default\n");
    printf("        is 75 percent.\n");
    printf("  -m# : Compress file only if its uncompressed size is at least # bytes.  If\n");
    printf("        this option is not specified, the default is 0.\n");
    printf("  -xa[,b[,c...]] : Ignore files with the specified extension(s).  For example,\n");
    printf("        -xzip,gif would ignore ZIP and GIF files.\n");
    printf("  -q  : Operate quietly, with no status info displayed.\n\n");
    //printf("For example:  ccmprs d:\\letters\\*.txt -s -t66.6 -m500000\n\n");
    //printf("This would examine all uncompressed files with file extension .txt, in the\n");
    //printf("directory d:\\letters and all of its subdirectories.  Each file at least 500000\n");
    //printf("bytes in length is compressed.  If the size of the resulting compressed file is\n");
    //printf("66.6%% or less of the uncompressed size, the file is left compressed, otherwise\n");
    //printf("it is restored to its original uncompressed state.\n");
}


//**************************************************************************
//
//  Routine returns TRUE if volume containing the specified path supports
//  file compression, FALSE if not.  The path is assumed to be a full path,
//  either UNC or DOS format.
//
//**************************************************************************
BOOL DriveIsCompressible(LPSTR lpszFileSpec)
{
    char  szRoot[4];
    DWORD dwFlags;
    BOOL  bRet = FALSE;

    do
    {
        // Extract the root directory.
        strncpy(szRoot, lpszFileSpec, 3);
        szRoot[3] = 0;

        // Get information on the volume.
        if (!GetVolumeInformation(szRoot, NULL, 0, NULL, NULL, &dwFlags, NULL, NULL))
            break;

        // Return TRUE if volume supports file compression.
        if (dwFlags & FS_FILE_COMPRESSION)
            bRet = TRUE;

    } while (FALSE);

    return bRet;
}


//**************************************************************************
//  Routine to read the command line parameters and set the various global
//  variables accordingly.
//**************************************************************************
BOOL GetParameters(int ac, char *av[])
{
    int i;

    // For each item in the command line...
    for (i = 1; i < ac; i++)
    {
        // Process option or file specification.
        if (*av[i] == '-')
        {
            switch (*(av[i] + 1))
            {
                case 's':               // The "look at subdirectories" option
                case 'S':
                    bRecurse = TRUE;
                    break;

                case 'q':               // The "be quiet!" option
                case 'Q':
                    bQuiet = TRUE;
                    break;

                case 'd':               // The "decompress" option
                case 'D':
                    bDecompress = TRUE;
                    break;

                case 'm':               // The "minimum size" option
                case 'M':
                    MinFileSize = atof(av[i] + 2);
                    if (MinFileSize < 0)
                    {
                        printf("Invalid minimum file size of %.0lf bytes specified.\n", MinFileSize);
                        return FALSE;
                    }
                    break;

                case 't':               // The "compression threshold" option
                case 'T':
                    threshold = atof(av[i] + 2);
                    if (threshold <= 0 || threshold > 100.0)
                    {
                        printf("Invalid compression threshold of %lf%% specified.\n", threshold);
                        return FALSE;
                    }
                    threshold /= 100.0;
                    break;

                case 'x':               // The "ignore file extensions" option
                case 'X':
                    if (*(av[i] + 2))
                    {
                        if (szIgnoreExts)
                        {
                            // Append extensions to current list of extensions.
                            char *p = (char *)realloc(szIgnoreExts, strlen(szIgnoreExts) + strlen(av[i] + 2) + 2);
                            if (p)
                            {
                                szIgnoreExts = p;
                                strcat(szIgnoreExts, ",");
                                strcat(szIgnoreExts, av[i] + 2);
                                strlwr(szIgnoreExts);
                            }
                        }
                        else
                        {
                            // Make new list of extensions.
                            szIgnoreExts = (char *)malloc(strlen(av[i] + 2) + 1);
                            if (szIgnoreExts)
                            {
                                strcpy(szIgnoreExts, av[i] + 2);
                                strlwr(szIgnoreExts);
                            }
                        }

                    }
                    break;

                default:
                    printf("The -%c option is not a valid option.\n", *(av[i] + 1));
                    return FALSE;
            }
        }
        else
        {
            _fullpath(szFileSpec, av[i], _MAX_PATH);
        }
    }

    // Check for file name.
    if (!szFileSpec[0])
    {
        printf("No file name was specified.\n");
        return FALSE;
    }

    // Make sure that the drive supports compression.
    if (!DriveIsCompressible(szFileSpec))
    {
        printf("The specified volume does not support file-level compression.\n");
        return FALSE;
    }

    // Allocate space for copy of file extensions string.
    if (szIgnoreExts)
    {
        szExts = (char *)malloc(strlen(szIgnoreExts) + 1);
        if (!szExts)
        {
            free(szIgnoreExts);
            szIgnoreExts = NULL;
        }
    }

    return TRUE;
}


//**************************************************************************
//**************************************************************************
BOOL SetFileCompression(LPSTR lpszFile, BOOL bCompress)
{
    HANDLE hFile;
    USHORT uMode;
    DWORD  dwAttributes;
    BOOL   bRet = FALSE;

    do
    {
        // Get the file's current compression state.
        dwAttributes = GetFileAttributes(lpszFile);
        if (dwAttributes == 0xFFFFFFFF)
            break;

        // If the file is already in the desired state, return now.
        if (!bCompress == !(dwAttributes & FILE_ATTRIBUTE_COMPRESSED))
        {
            bRet = TRUE;
            break;
        }

        // Open the file.
        hFile = CreateFile(szTemp, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_READONLY, NULL);
        if (hFile == INVALID_HANDLE_VALUE)
            break;

        // Set the file's compression state.
        uMode = bCompress ? COMPRESSION_FORMAT_DEFAULT : COMPRESSION_FORMAT_NONE;
        bRet = DeviceIoControl(hFile, FSCTL_SET_COMPRESSION, &uMode, sizeof(uMode), NULL, 0, &dwAttributes, NULL);

        // Close the file.
        CloseHandle(hFile);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
美女www一区二区| 日韩欧美国产小视频| 菠萝蜜视频在线观看一区| 国产曰批免费观看久久久| 男女视频一区二区| 麻豆精品在线看| 卡一卡二国产精品| 国产乱子轮精品视频| 国产精品亚洲第一| 成人av午夜电影| www.欧美精品一二区| 色综合一区二区三区| 色婷婷激情一区二区三区| 色久综合一二码| 欧美三级韩国三级日本一级| 欧美视频一区二区三区四区| 欧美卡1卡2卡| 欧美一级免费观看| 精品国产第一区二区三区观看体验 | 亚洲欧美综合色| 亚洲日本在线看| 亚洲影院在线观看| 亚洲成人资源在线| 麻豆国产91在线播放| 国产精品一区三区| av日韩在线网站| 欧美视频一区二区三区| 日韩欧美国产精品| 亚洲国产精品精华液2区45| 亚洲色欲色欲www| 午夜精品福利一区二区三区蜜桃| 视频一区视频二区在线观看| 九色porny丨国产精品| 国产大片一区二区| 日本高清视频一区二区| 5858s免费视频成人| 国产亚洲自拍一区| 亚洲激情成人在线| 久久不见久久见免费视频1| 成人综合在线网站| 欧美精品日韩综合在线| 久久久噜噜噜久久中文字幕色伊伊| 国产精品丝袜黑色高跟| 亚洲国产一区在线观看| 国内久久精品视频| 色综合久久久久久久久久久| 91精品国产aⅴ一区二区| 国产精品进线69影院| 日韩经典中文字幕一区| 成人一区二区三区在线观看| 欧美人成免费网站| 中文字幕av资源一区| 丝袜国产日韩另类美女| 大美女一区二区三区| 欧美电影在哪看比较好| 国产精品视频一区二区三区不卡| 亚洲一区在线视频| 国产91对白在线观看九色| 欧美日韩国产精选| 欧美国产禁国产网站cc| 日本三级亚洲精品| 色偷偷久久人人79超碰人人澡| 日韩免费在线观看| 亚洲一区二区欧美| 99视频精品在线| 精品国产免费人成在线观看| 亚洲精品久久久蜜桃| 国产成人综合亚洲网站| 在线成人免费视频| 亚洲精品中文在线| 国产精品123| 欧美一区二区精美| 亚洲国产另类精品专区| 91视频观看免费| 精品99一区二区三区| 五月激情综合色| 色先锋资源久久综合| 中文av一区二区| 国产永久精品大片wwwapp| 欧美精品视频www在线观看 | 国内精品久久久久影院色| 欧美午夜精品久久久久久孕妇| 日本一区二区不卡视频| 国产一区二区在线免费观看| 欧美年轻男男videosbes| 亚洲激情五月婷婷| www.成人在线| 国产精品无人区| 国产传媒久久文化传媒| 久久综合久色欧美综合狠狠| 秋霞影院一区二区| 欧美军同video69gay| 天堂va蜜桃一区二区三区漫画版 | 久久综合色8888| 久久99国产精品久久99 | 一区二区欧美国产| 91丨porny丨国产| 中文字幕一区av| av亚洲精华国产精华| 国产欧美综合色| 懂色一区二区三区免费观看| 久久精品在线免费观看| 高清久久久久久| 欧美极品美女视频| 99这里都是精品| 亚洲乱码国产乱码精品精小说 | 91麻豆精品国产综合久久久久久| 亚洲精品视频观看| 欧美在线啊v一区| 亚洲亚洲精品在线观看| 欧美丰满美乳xxx高潮www| 日本vs亚洲vs韩国一区三区| 日韩色视频在线观看| 精品综合免费视频观看| 精品国产污污免费网站入口| 国产成人在线观看| 最新热久久免费视频| 色综合久久久久网| 水蜜桃久久夜色精品一区的特点 | 中文字幕av一区二区三区免费看| 成人免费观看视频| 亚洲欧美另类在线| 欧美日韩一区国产| 久久草av在线| 中文字幕精品一区二区三区精品| 91亚洲精品久久久蜜桃| 亚洲在线成人精品| 日韩精品最新网址| 成人毛片视频在线观看| 一区二区三区鲁丝不卡| 制服丝袜成人动漫| 国产盗摄一区二区三区| 亚洲免费高清视频在线| 欧美一区在线视频| 国产精品一区在线| 亚洲一区二区3| 精品成人一区二区三区| 91美女片黄在线观看91美女| 亚洲福利一区二区三区| 精品裸体舞一区二区三区| 北条麻妃一区二区三区| 亚洲二区视频在线| 国产亚洲精品福利| 欧美在线|欧美| 国产精品中文欧美| 亚洲一区在线观看免费观看电影高清| 欧美一区二区三区色| 成人高清视频在线观看| 丝袜美腿亚洲一区二区图片| 日本一区二区三区四区| 777色狠狠一区二区三区| 国产精品亚洲午夜一区二区三区| 亚洲精品国产一区二区精华液| 日韩欧美色综合| 色综合色综合色综合| 九九精品视频在线看| 艳妇臀荡乳欲伦亚洲一区| 久久夜色精品一区| 欧美丝袜丝交足nylons| 国产风韵犹存在线视精品| 日韩中文字幕亚洲一区二区va在线| 国产欧美一区视频| 6080日韩午夜伦伦午夜伦| 91丝袜国产在线播放| 国内精品在线播放| 天天影视色香欲综合网老头| 国产精品免费av| 日韩美一区二区三区| 在线视频国内一区二区| 国产成人精品免费在线| 欧美96一区二区免费视频| 亚洲免费av在线| 国产精品日日摸夜夜摸av| 日韩视频免费观看高清完整版 | 日韩欧美国产综合在线一区二区三区 | 99精品视频一区二区三区| 麻豆成人综合网| 亚洲成av人片| 亚洲靠逼com| 中文字幕一区二区三区四区| 精品乱码亚洲一区二区不卡| 欧美精品乱码久久久久久按摩| 91亚洲男人天堂| 成人av网站在线| 国产精品综合一区二区| 蜜桃av一区二区三区| 亚洲国产综合视频在线观看| 日韩码欧中文字| 国产精品免费久久久久| 欧美国产综合色视频| 久久精品视频在线免费观看| 精品国产免费人成在线观看| 日韩欧美资源站| 欧美一级一区二区| 91精品国产综合久久香蕉麻豆| 欧美私人免费视频| 欧美视频一区二区三区| 在线观看视频一区二区| 在线观看日韩高清av| 欧美专区日韩专区|