zoukankan      html  css  js  c++  java
  • Using X++ Code found out files list

    static void Jimmy_FindFilesWinAPI(Args _args)
    {
        #File
        int i;
    
        FileName fullFileName(FileName _path, FileName _fileName)
        {
            FileName pathName;
            FileName fileName;
            FileName fileExtension;
            ;
            [pathName,fileName,fileExtension] = fileNameSplit(_fileName);
            return _path + '\\' + fileName + fileExtension;
        }
    
        void findFiles( FileName    _path,
                        FileName    _fileName,
                        boolean     _inclSubDir = true,
                        FileName    _prefix     = fullFileName(_path,_fileName))
        {
            FileName    fileName,FullName;
            int         hdl;
            ;
            setprefix(_prefix);
            if (WinAPI::folderExists(_path))
            {
                [hdl,fileName] = WinApi::findFirstFile(fullFileName(_path,_fileName));
                while (fileName)
                {
                    FullName = fullFileName(_path,fileName);
                    if (WinAPI::fileExists(FullName))
                    {
                        i++;
                        info(strfmt("%3 , %1 - %2",FullName,fileName,i));
                    }
                    fileName = WinApi::findNextFile(hdl);
                }
                WinApi::findClose(hdl);
                if (_inclSubDir)
                {
                    [hdl, fileName] = WinAPI::findFirstFile(_path+'\\'+#AllFiles);
                    while (fileName)
                    {
                        if (strlwr(fileName) != strlwr(_fileName) &&
                        strlwr(fileName) != strlwr('.') &&
                        strlwr(fileName) != strlwr('..') &&
                        WinAPI::pathExists(fullFileName(_path,fileName)))
    
                        findFiles(fullFileName(_path,fileName), _fileName, _inclSubDir,
                        fileName);
                        fileName = WinApi::findNextFile(hdl);
    
                    }
                    WinApi::findClose(hdl);
                }
            }
        }
    ;
        findFiles('c:\\Program Files','*.doc');
    }
    
  • 相关阅读:
    【R】如何去掉数据框中包含非数值的行?
    解读NoSQL数据库的四大家族
    MapReduce
    从网站上扒网页,保存为file文件格式
    jfinal 模板引擎
    pycharm的版本对应问题
    AttributeError: module 'DBBase' has no attribute 'DBBase'
    四则运算 python
    用命令行去运行程序
    Pandas入门CNV.TXT数据分析
  • 原文地址:https://www.cnblogs.com/Fandyx/p/2104491.html
Copyright © 2011-2022 走看看