Woodstock Geschrieben 21. November 2001 Autor Teilen Geschrieben 21. November 2001 Nun, ich weiß was mir das Struct zurück gibt: <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Zitat:</font><HR> _find, _wfind Functions These functions search for and close searches for specified filenames. _findclose _findnext, _findnexti64, _wfindnext, _wfindnexti64 _findfirst, _findfirsti64, _wfindfirst, _wfindfirsti64 Remarks The _findfirst function provides information about the first instance of a filename that matches the file specified in the filespec argument. Any wildcard combination supported by the host operating system can be used in filespec. File information is returned in a _finddata_t structure, defined in IO.H. The _finddata_t structure includes the following elements: unsigned attrib File attribute time_t time_create Time of file creation ( –1L for FAT file systems) time_t time_access Time of last file access (–1L for FAT file systems) time_t time_write Time of last write to file _fsize_t size Length of file in bytes char name[_MAX_FNAME] Null-terminated name of matched file/directory, without the path In file systems that do not support the creation and last access times of a file, such as the FAT system, the time_create and time_access fields are always –1L. _MAX_FNAME is defined in STDLIB.H as 256 bytes. You cannot specify target attributes (such as _A_RDONLY) by which to limit the find operation. This attribute is returned in the attrib field of the _finddata_t structure and can have the following values (defined in IO.H). _A_ARCH Archive. Set whenever the file is changed, and cleared by the BACKUP command. Value: 0x20 _A_HIDDEN Hidden file. Not normally seen with the DIR command, unless the /AH option is used. Returns information about normal files as well as files with this attribute. Value: 0x02 _A_NORMAL Normal. File can be read or written to without restriction. Value: 0x00 _A_RDONLY Read-only. File cannot be opened for writing, and a file with the same name cannot be created. Value: 0x01 _A_SUBDIR Subdirectory. Value: 0x10 _A_SYSTEM System file. Not normally seen with the DIR command, unless the /A or /A:S option is used. Value: 0x04 _findnext finds the next name, if any, that matches the filespec argument specified in a prior call to _findfirst. The fileinfo argument should point to a structure initialized by a previous call to _findfirst. If a match is found, the fileinfo structure contents are altered as described above. _findclose closes the specified search handle and releases all associated resources for both _findfirst and _findnext. The handle returned by either _findfirst or _findnext must first be passed to _findclose, before modification operations, such as deleting, can be performed on the directories that form the paths passed to them. The _find functions allow nested calls. For example, if the file found by a call to _findfirst or _findnext is a subdirectory, a new search can be initiated with another call to _findfirst or _findnext. _wfindfirst and _wfindnext are wide-character versions of _findfirst and _findnext. The structure argument of the wide-character versions has the _wfinddata_t data type, which is defined in IO.H and in WCHAR.H. The fields of this data type are the same as those of the _finddata_t data type, except that in _wfinddata_t the name field is of type wchar_t rather than type char. Otherwise _wfindfirst and _wfindnext behave identically to _findfirst and _findnext. Functions _findfirsti64, _findnexti64, _wfindfirsti64, and _wfindnexti64 also behave identically except they use and return 64-bit file lengths. Zitieren Link zu diesem Kommentar Auf anderen Seiten teilen Mehr Optionen zum Teilen...
DocMabuse Geschrieben 22. November 2001 Teilen Geschrieben 22. November 2001 <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Zitat:</font><HR>Original erstellt von Woodstock: <STRONG>Nun, ich weiß was mir das Struct zurück gibt: Und ich kann mir das auch ausgeben lassen. Soweit kein Problem. Nur, 1. Problem: Ich bekomme den Dateinamen, nicht aber den Pfad dazu. Wie kann ich das anstellen mir auch den Pfad geben zu lassen? 2. Problem: Ich soll auch die Unterverzeichnisse durchsuchen, und zwar rekursiv. Und dabei kommt dann Problem eins auch dazu. 3. Problem: Wenn ich ja bestimmte Dateitypen suche (z.B. *.txt, *.doc), dann suche ich gezielt danach, dann gibt er mir aber doch die Unterverzeichnisse nicht mit aus. Ich hab da einfach ein Brett vorm Kopf. Bine</STRONG> Zitieren Link zu diesem Kommentar Auf anderen Seiten teilen Mehr Optionen zum Teilen...
Empfohlene Beiträge
Dein Kommentar
Du kannst jetzt schreiben und Dich später registrieren. Wenn Du ein Konto hast, melde Dich jetzt an, um unter Deinem Benutzernamen zu schreiben.