Findfile
Author: a | 2025-04-24
findfile()Findfile Description Syntax Remarksandexamples Conformability Diagnostics Alsosee Description findfile(fn,dirlist)looksforfilefnalongthesemicolon Free download FindFile OSAX FindFile OSAX for Mac OS X. The FindFile OSAX is a scripting addition offering a collection of functions that allow
GitHub - choksheak/findfile: findfile is a handy, cross
Internet Programming with WinInet.Inheritance HierarchyCObjectCFileFindRequirementsHeader: afx.h CFileFind::CFileFindThis member function is called when a CFileFind object is constructed.CFileFind();CFileFind(CAtlTransactionManager* pTM);ParameterspTMPointer to CAtlTransactionManager objectExampleSee the example for CFileFind::GetFileName. CFileFind::CloseCall this member function to end the search, reset the context, and release all resources.RemarksAfter calling Close, you do not have to create a new CFileFind instance before calling FindFile to begin a new search.ExampleSee the example for CFileFind::GetFileName. CFileFind::CloseContextCloses the file specified by the current search handle.virtual void CloseContext();RemarksCloses the file specified by the current value of the search handle. Override this function to change the default behavior.You must call the FindFile or FindNextFile functions at least once to retrieve a valid search handle. The FindFile and FindNextFile functions use the search handle to locate files with names that match a given name. CFileFind::FindFileCall this member function to open a file search.virtual BOOL FindFile( LPCTSTR pstrName = NULL, DWORD dwUnused = 0);ParameterspstrNameA pointer to a string containing the name of the file to find. If you pass NULL for pstrName, FindFile does a wildcard (*.*) search.dwUnusedReserved to make FindFile polymorphic with derived classes. Must be 0.Return ValueNonzero if successful; otherwise 0. To get extended error information, call the Win32 function GetLastError.RemarksAfter calling FindFile to begin the file search, call FindNextFile to retrieve subsequent files. You must call FindNextFile at least once before calling any of the following attribute member functions:GetCreationTimeGetFileNameGetFileTitleGetFilePathGetFileURLGetLastAccessTimeGetLastWriteTimeGetLengthGetRootIsArchivedIsCompressedIsDirectoryIsDotsIsHiddenIsNormalIsReadOnlyIsSystemIsTemporaryMatchesMaskExampleSee the example for CFileFind::IsDirectory. CFileFind::FindNextFileCall this member function to continue a file search from a previous call to FindFile.virtual BOOL FindNextFile();Return ValueNonzero if there are more files; zero if the file found is the last one in the directory or if an error occurred. To get extended error information, call the Win32 function GetLastError. If the file found is the last file in the directory, or if no matching files can be found, the GetLastError function returns ERROR_NO_MORE_FILES.RemarksYou must call FindNextFile at least once before calling any of the following attribute member functions:GetCreationTimeGetFileNameGetFileTitleGetFilePathGetFileURLGetLastAccessTimeGetLastWriteTimeGetLengthGetRootIsArchivedIsCompressedIsDirectoryIsDotsIsHiddenIsNormalIsReadOnlyIsSystemIsTemporaryMatchesMaskFindNextFile wraps the Win32 function FindNextFile.ExampleSee the example for CFileFind::IsDirectory. CFileFind::GetCreationTimeCall this member function to get the time the specified file was created.virtual BOOL GetCreationTime(FILETIME* pTimeStamp) const;virtual BOOL GetCreationTime(CTime& refTime) const;ParameterspTimeStampA pointer to a FILETIME structure containing the time the file was created.refTimeA reference to a CTime object.Return ValueNonzero if successful; 0 if unsuccessful. GetCreationTime returns 0 only if FindNextFile has never been called on this CFileFind object.RemarksYou must call FindNextFile at least once before calling GetCreationTime.NoteNot all file systems use the same semantics to implement the time stamp returned by this function. This function may return the same value returned by other time stamp functions if the underlying file system or server does not support keeping the time attribute. See the WIN32_FIND_DATA structure for information about time formats. On some operation systems, the returned time is in the time zone local to the machine were the file is located. See the Win32 FileTimeToLocalFileTime API for more information.ExampleSee the example for CFileFind::GetLength. CFileFind::GetFileNameCall this member function to get the name of the found file.virtual CString GetFileName() const;Return ValueThe name of the most-recently-found. findfile()Findfile Description Syntax Remarksandexamples Conformability Diagnostics Alsosee Description findfile(fn,dirlist)looksforfilefnalongthesemicolon Free download FindFile OSAX FindFile OSAX for Mac OS X. The FindFile OSAX is a scripting addition offering a collection of functions that allow Typing findfile acaddoc.lsp when pressing space in the command line it's considered as enter and autocad gives . findfile Unknown command FINDFILE . Press F1 for Here syntax for FindFile method of application object in VBA. Application. FindFile. It returns a Boolean value either True or False. And, Application is object and FindFile method is the application object. VBA FindFile Application Method: Example 1. Please find the below example for FindFile method of application object in excel VBA. nDirs = nDirs 1 If fld.SubFolders.Count 0 Then For Each tFld In fld.SubFolders DoEvents FindFile = FindFile FindFile(tFld.Path, sFile, nDirs, nFiles) Next End If Exit Description. Finding all files with a given file specification filespec. Examples. f = findfiles f = findfiles (SCI) f = findfiles (SCI ' /modules/core/macros Forum General Programming Boards C++ Programming How to display all files, subfiles and directories 11-06-2019 #1 Registered User How to display all files, subfiles and directories I know about FindFirstFile/FindNextFile, so how can i display along the path, for example, C:\Program Files\, all folders and all files enclosed within them, in general, all directories and files along this path. Using only WinAPI + FindFirstFile/FindNextFile, without Boost/Filesystem/dirent.h and etc. Looks like a recursion output with dirent.h, such as: Code: #include #include #include #include "iostream"#include "string"#include #include using namespace std;void listFilesRecursively(char *path);int main(){ setlocale(LC_ALL , "Russian"); char path[100]; printf("Enter path to list files: "); scanf("%s", path); listFilesRecursively(path); return 0;}void listFilesRecursively(char *basePath){ WIN32_FILE_ATTRIBUTE_DATA Info; char path[1000]; struct dirent *dp; DIR *dir = opendir(basePath); if (!dir) return; while ((dp = readdir(dir)) != NULL) { if (strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) { printf("%s\n", dp->d_name); strcpy(path, basePath); strcat(path, "/"); strcat(path, dp->d_name); string path_s = (const char*) path; GetFileAttributesEx(path_s.c_str(), GetFileExInfoStandard, &Info); coutBut how to do this using only WinAPI?I tried like this: Code: #include #include #include #include void FindFile(const std::wstring &directory){ std::wstring tmp = directory + L"\\*"; WIN32_FIND_DATAW file; HANDLE search_handle = FindFirstFileW(tmp.c_str(), &file); if (search_handle != INVALID_HANDLE_VALUE) { std::vector directories; do { if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if ((!lstrcmpW(file.cFileName, L".")) || (!lstrcmpW(file.cFileName, L".."))) continue; } tmp = directory + L"\" + std::wstring(file.cFileName); std::wcout ::iterator iter = directories.begin(), end = directories.end(); iter != end; ++iter) FindFile(*iter); }}int main(){ FindFile(L"C:"); return 0;}But it only displays if the path is in the form of "C:" and does not display subfolders with files. 11-06-2019 #2 Registered User Maybe more like this. (Sorry, but I couldn't test it). Code: void FindFile(std::wstring dir){ dir += L"\\*"; WIN32_FIND_DATAW file; HANDLE search = FindFirstFileW(dir.c_str(), &file); if (search == INVALID_HANDLE_VALUE) return; dir.pop_back(); // remove asterisk do { if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORYComments
Internet Programming with WinInet.Inheritance HierarchyCObjectCFileFindRequirementsHeader: afx.h CFileFind::CFileFindThis member function is called when a CFileFind object is constructed.CFileFind();CFileFind(CAtlTransactionManager* pTM);ParameterspTMPointer to CAtlTransactionManager objectExampleSee the example for CFileFind::GetFileName. CFileFind::CloseCall this member function to end the search, reset the context, and release all resources.RemarksAfter calling Close, you do not have to create a new CFileFind instance before calling FindFile to begin a new search.ExampleSee the example for CFileFind::GetFileName. CFileFind::CloseContextCloses the file specified by the current search handle.virtual void CloseContext();RemarksCloses the file specified by the current value of the search handle. Override this function to change the default behavior.You must call the FindFile or FindNextFile functions at least once to retrieve a valid search handle. The FindFile and FindNextFile functions use the search handle to locate files with names that match a given name. CFileFind::FindFileCall this member function to open a file search.virtual BOOL FindFile( LPCTSTR pstrName = NULL, DWORD dwUnused = 0);ParameterspstrNameA pointer to a string containing the name of the file to find. If you pass NULL for pstrName, FindFile does a wildcard (*.*) search.dwUnusedReserved to make FindFile polymorphic with derived classes. Must be 0.Return ValueNonzero if successful; otherwise 0. To get extended error information, call the Win32 function GetLastError.RemarksAfter calling FindFile to begin the file search, call FindNextFile to retrieve subsequent files. You must call FindNextFile at least once before calling any of the following attribute member functions:GetCreationTimeGetFileNameGetFileTitleGetFilePathGetFileURLGetLastAccessTimeGetLastWriteTimeGetLengthGetRootIsArchivedIsCompressedIsDirectoryIsDotsIsHiddenIsNormalIsReadOnlyIsSystemIsTemporaryMatchesMaskExampleSee the example for CFileFind::IsDirectory. CFileFind::FindNextFileCall this member function to continue a file search from a previous call to FindFile.virtual BOOL FindNextFile();Return ValueNonzero if there are more files; zero if the file found is the last one in the directory or if an error occurred. To get extended error information, call the Win32 function GetLastError. If the file found is the last file in the directory, or if no matching files can be found, the GetLastError function returns ERROR_NO_MORE_FILES.RemarksYou must call FindNextFile at least once before calling any of the following attribute member functions:GetCreationTimeGetFileNameGetFileTitleGetFilePathGetFileURLGetLastAccessTimeGetLastWriteTimeGetLengthGetRootIsArchivedIsCompressedIsDirectoryIsDotsIsHiddenIsNormalIsReadOnlyIsSystemIsTemporaryMatchesMaskFindNextFile wraps the Win32 function FindNextFile.ExampleSee the example for CFileFind::IsDirectory. CFileFind::GetCreationTimeCall this member function to get the time the specified file was created.virtual BOOL GetCreationTime(FILETIME* pTimeStamp) const;virtual BOOL GetCreationTime(CTime& refTime) const;ParameterspTimeStampA pointer to a FILETIME structure containing the time the file was created.refTimeA reference to a CTime object.Return ValueNonzero if successful; 0 if unsuccessful. GetCreationTime returns 0 only if FindNextFile has never been called on this CFileFind object.RemarksYou must call FindNextFile at least once before calling GetCreationTime.NoteNot all file systems use the same semantics to implement the time stamp returned by this function. This function may return the same value returned by other time stamp functions if the underlying file system or server does not support keeping the time attribute. See the WIN32_FIND_DATA structure for information about time formats. On some operation systems, the returned time is in the time zone local to the machine were the file is located. See the Win32 FileTimeToLocalFileTime API for more information.ExampleSee the example for CFileFind::GetLength. CFileFind::GetFileNameCall this member function to get the name of the found file.virtual CString GetFileName() const;Return ValueThe name of the most-recently-found
2025-04-21Forum General Programming Boards C++ Programming How to display all files, subfiles and directories 11-06-2019 #1 Registered User How to display all files, subfiles and directories I know about FindFirstFile/FindNextFile, so how can i display along the path, for example, C:\Program Files\, all folders and all files enclosed within them, in general, all directories and files along this path. Using only WinAPI + FindFirstFile/FindNextFile, without Boost/Filesystem/dirent.h and etc. Looks like a recursion output with dirent.h, such as: Code: #include #include #include #include "iostream"#include "string"#include #include using namespace std;void listFilesRecursively(char *path);int main(){ setlocale(LC_ALL , "Russian"); char path[100]; printf("Enter path to list files: "); scanf("%s", path); listFilesRecursively(path); return 0;}void listFilesRecursively(char *basePath){ WIN32_FILE_ATTRIBUTE_DATA Info; char path[1000]; struct dirent *dp; DIR *dir = opendir(basePath); if (!dir) return; while ((dp = readdir(dir)) != NULL) { if (strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) { printf("%s\n", dp->d_name); strcpy(path, basePath); strcat(path, "/"); strcat(path, dp->d_name); string path_s = (const char*) path; GetFileAttributesEx(path_s.c_str(), GetFileExInfoStandard, &Info); coutBut how to do this using only WinAPI?I tried like this: Code: #include #include #include #include void FindFile(const std::wstring &directory){ std::wstring tmp = directory + L"\\*"; WIN32_FIND_DATAW file; HANDLE search_handle = FindFirstFileW(tmp.c_str(), &file); if (search_handle != INVALID_HANDLE_VALUE) { std::vector directories; do { if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { if ((!lstrcmpW(file.cFileName, L".")) || (!lstrcmpW(file.cFileName, L".."))) continue; } tmp = directory + L"\" + std::wstring(file.cFileName); std::wcout ::iterator iter = directories.begin(), end = directories.end(); iter != end; ++iter) FindFile(*iter); }}int main(){ FindFile(L"C:"); return 0;}But it only displays if the path is in the form of "C:" and does not display subfolders with files. 11-06-2019 #2 Registered User Maybe more like this. (Sorry, but I couldn't test it). Code: void FindFile(std::wstring dir){ dir += L"\\*"; WIN32_FIND_DATAW file; HANDLE search = FindFirstFileW(dir.c_str(), &file); if (search == INVALID_HANDLE_VALUE) return; dir.pop_back(); // remove asterisk do { if (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
2025-04-18QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant)));Or call the function directly: QVariantList params = ... QVariant result = object->dynamicCall("Dummy5(QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant, QVariant)", params);QVariant Dummy6 () [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal()), object, SLOT(Dummy6()));Or call the function directly: QVariant result = object->dynamicCall("Dummy6()");QVariant Dummy7 () [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal()), object, SLOT(Dummy7()));Or call the function directly: QVariant result = object->dynamicCall("Dummy7()");QVariant Dummy8 (QVariant Arg1) [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal(QVariant)), object, SLOT(Dummy8(QVariant)));Or call the function directly: QVariantList params = ... QVariant result = object->dynamicCall("Dummy8(QVariant)", params);QVariant Dummy9 () [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal()), object, SLOT(Dummy9()));Or call the function directly: QVariant result = object->dynamicCall("Dummy9()");QVariant Evaluate (QVariant Name) [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal(QVariant)), object, SLOT(Evaluate(QVariant)));Or call the function directly: QVariantList params = ... QVariant result = object->dynamicCall("Evaluate(QVariant)", params);QVariant ExecuteExcel4Macro (QString String) [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal(QString)), object, SLOT(ExecuteExcel4Macro(QString)));Or call the function directly: QVariantList params = ... QVariant result = object->dynamicCall("ExecuteExcel4Macro(QString)", params);QVariant FileConverters (QVariant Index1, QVariant Index2) [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal(QVariant, QVariant)), object, SLOT(FileConverters(QVariant, QVariant)));Or call the function directly: QVariantList params = ... QVariant result = object->dynamicCall("FileConverters(QVariant, QVariant)", params);IDispatch* FileDialog (Office::MsoFileDialogType fileDialogType) [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal(Office::MsoFileDialogType)), object, SLOT(FileDialog(Office::MsoFileDialogType)));Or call the function directly: QVariantList params = ... QAxObject * result = object->querySubObject("FileDialog(Office::MsoFileDialogType)", params);bool FindFile () [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal()), object, SLOT(FindFile()));Or call the function directly: bool result = object->dynamicCall("FindFile()").toBool();QVariant GetCustomListContents (int ListNum) [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal(int)), object, SLOT(GetCustomListContents(int)));Or call the function directly: QVariantList params = ... QVariant result = object->dynamicCall("GetCustomListContents(int)", params);int GetCustomListNum (QVariant ListArray) [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal(QVariant)), object, SLOT(GetCustomListNum(QVariant)));Or call the function directly: QVariantList params = ... int result = object->dynamicCall("GetCustomListNum(QVariant)", params).toInt();QVariant GetOpenFilename (QVariant FileFilter, QVariant FilterIndex, QVariant Title, QVariant ButtonText, QVariant MultiSelect) [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal(QVariant, QVariant, QVariant, QVariant, QVariant)), object, SLOT(GetOpenFilename(QVariant, QVariant, QVariant, QVariant, QVariant)));Or call the function directly: QVariantList params = ... QVariant result = object->dynamicCall("GetOpenFilename(QVariant, QVariant, QVariant, QVariant, QVariant)", params);QString GetPhonetic (QVariant Text) [slot]For more information, see help context 65537 in C:\Program Files\Microsoft Office\Office12\VBAXL10.CHM.Connect a signal to this slot: QObject::connect(sender, SIGNAL(someSignal(QVariant)), object, SLOT(GetPhonetic(QVariant)));Or call the function directly: QVariantList params = ... QString result
2025-04-06