|
Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
|
Searches for files and directories. More...
#include <f32file.h>
Public Member Functions | |
| IMPORT_C | TFindFile (RFs &aFs) |
| Constructor taking a file server session. | |
| IMPORT_C TInt | FindByPath (const TDesC &aFileName, const TDesC *aPathList) |
| Searches for a file/directory in one or more directories in the path. | |
| IMPORT_C TInt | FindByDir (const TDesC &aFileName, const TDesC &aDirPath) |
| Searches for a file/directory in a directory on all available drives. | |
| IMPORT_C TInt | Find () |
| Searches for the next file/directory. | |
| IMPORT_C TInt | FindWildByPath (const TDesC &aFileName, const TDesC *aPathList, CDir *&aDirList) |
| Searches for one or more files/directories in the directories contained in a path list. | |
| IMPORT_C TInt | FindWildByDir (const TDesC &aFileName, const TDesC &aDirPath, CDir *&aDir) |
| Searches, using wildcards, for one or more files/directories in a specified directory. | |
| IMPORT_C TInt | FindWild (CDir *&aDirList) |
| Searches for the next file/directory. | |
| IMPORT_C TInt | SetFindMask (TUint aMask) |
| Can be used in order to specify a combination of drive attributes that the drives to be searched must match. | |
| const TDesC & | File () const |
| Gets the full file specification of a file which was found by a successful call to any of the search variants that do not accept wildcards. | |
Searches for files and directories.
Each function has a variant which searches for multiple files/directories, using one or more wildcard characters in the filename. If an initial search is successful, further searches can be carried out using Find() or FindWild(). You can also retrieve the fully qualified file specification, and manipulate and interrogate it using the TParse class (or related classes).
Note that when specifying the path of a directory to search, the path should always end with a backslash character.When trailing backslash is not present then it is considered as file. And path will be taken till last backslash. The client must have appropriate capabilities for the directory to be searched. For example without ALL FILES Capability, it is not possible to successfully find any files under \sys\bin directory.
By default if the file is not found in the current drive the rest of the drives, excluding the remote ones, will be searched. Using function SetFindMask it is possible to specify a combination of drive attributes(aMask) that the drives to be searched must match.
| IMPORT_C TFindFile::TFindFile | ( | RFs & | aFs | ) |
Constructor taking a file server session.
| aFs | File server session. |
(generated from Symbian Developer Library)
|
inline |
Gets the full file specification of a file which was found by a successful call to any of the search variants that do not accept wildcards.
The file specification includes drive, path and filename.
Notes:
(generated from Symbian Developer Library)
| IMPORT_C TInt TFindFile::Find | ( | ) |
Searches for the next file/directory.
This should be used after a successful call to FindByPath() or FindByDir(), to find the next occurrence of the filename in the path or drive list.
Using function SetFindMask it is possible to specify a combination of attributes that the drives to be searched must match.
Note:
TFindFile::FindByPath TFindFile::FindByDir TFindFile::File TFindFile::SetFindMask()
(generated from Symbian Developer Library)
Searches for a file/directory in a directory on all available drives.
The search ends when the file/directory is found, or when every available drive has been unsuccessfully searched.
Notes:
TFindFile::FindWildByDir() TFindFile::File() TFindFile::Find() TFindFile::SetFindMask()
| aFileName | The filename to search for. If a path is specified, it overrides the path specified in aDir. If no path is specified, the path contained in aDir is used. |
| aDirPath | A single path indicating a directory to be searched on each drive.When path is empty then session path will be used for the search. |
(generated from Symbian Developer Library)
Searches for a file/directory in one or more directories in the path.
The search ends when the file/directory is found, or when every directory specified in the path list has been unsuccessfully searched.
Notes:
TFindFile::FindWildByPath TFindFile::File TFindFile::Find
| aFileName | The filename to search for. If this specifies a directory as well as a filename, then that directory is searched first. |
| aPathList | A list of directories to be searched. Paths in this list must be separated by a semicolon character, but a semicolon is not required after the final path. The directories are searched in the order in which they occur in the list. If a path in the list contains a drive letter, that drive alone is searched. If a path contains no drive letter, the function searches for the file in that directory on every available drive in turn, beginning with drive Y:, in descending alphabetical order and ending with drive Z:.When path is empty then session path will be used for the search. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TFindFile::FindWild | ( | CDir *& | aDirList | ) |
Searches for the next file/directory.
This should be used after a successful call to FindWildByPath() or FindWildByDir(), for the next occurrences of the filename in the path or drive list.Using function SetFindMask it is possible to specify a combination of attributes that the drives to be searched must match.
Notes:
out: On success a pointer to the internally allocated by this method CDir object, which in turn contains the entries for all files matching aFileName in the first directory in which a match occurred. In this case this API caller is responsible for deleting aDir. If some error occured (including KErrNotFound meaning that nothing found) this pointer will be set to NULL, which is also safe to delete.
TParse TEntry::iName TFindFile::File TFindFile::FindWildByPath TFindFile::FindWildByDir TFindFile::SetFindMask()
| aDirList | in: a reference to the pointer that will be modified by this method. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TFindFile::FindWildByDir | ( | const TDesC & | aFileName, |
| const TDesC & | aDirPath, | ||
| CDir *& | aDir | ||
| ) |
Searches, using wildcards, for one or more files/directories in a specified directory.
If no matching file is found in that directory, all available drives are searched in descending alphabetical order, from Y: to A:, and ending with the Z: drive.Using function SetFindMask it is possible to specify a combination of attributes that the drives to be searched must match.
The search ends when one or more matching filenames are found, or when every available drive has been unsuccessfully searched. To begin searching again after a successful match has been made, use FindWild(). Wildcards may be specified in the filename.
Notes:
out: On success a pointer to the internally allocated by this method CDir object, which in turn contains the entries for all files matching aFileName in the first directory in which a match occurred. In this case this API caller is responsible for deleting aDir. If some error occured (including KErrNotFound meaning that nothing found) this pointer will be set to NULL, which is also safe to delete.
TFindFile::FindWild TFindFile::File TFindFile::SetFindMask()
| aFileName | The filename to search for. May contain wildcards. If a path is specified, it overrides the path specified in aDirPath. If no path is specified, the path contained in aDirPath is used in the search. |
| aDirPath | Path indicating a directory to search on each drive. |
| aDir | in: a reference to the pointer that will be modified by this method. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TFindFile::FindWildByPath | ( | const TDesC & | aFileName, |
| const TDesC * | aPathList, | ||
| CDir *& | aDirList | ||
| ) |
Searches for one or more files/directories in the directories contained in a path list.
Wildcard characters can be specified. The search ends when one or more filenames matching aFileName is found, or when every directory in the path list has been unsuccessfully searched. To begin searching again after a successful match has been made, use FindWild().
Using function SetFindMask it is possible to specify a combination of attributes that the drives to be searched must match.
Notes:
out: On success a pointer to the internally allocated by this method CDir object, which in turn contains the entries for all files matching aFileName in the first directory in which a match occurred. In this case this API caller is responsible for deleting aDir. If some error occured (including KErrNotFound meaning that nothing found) this pointer will be set to NULL, which is also safe to delete.
TFindFile::FindWild TFindFile::File TEntry::iName TFindFile::SetFindMask()
| aFileName | The filename to search for. May contain wildcards. If it specifies a directory as well as a filename, then that directory is searched first. |
| aPathList | List of directories to search. Paths in this list must be separated by a semicolon character, but a semicolon is not required after the final path. The directories are searched in the order in which they occur in the list. Directories must be fully qualified, including a drive letter, and the name must end with a backslash. |
| aDirList | in: a reference to the pointer that will be modified by this method. |
(generated from Symbian Developer Library)
| IMPORT_C TInt TFindFile::SetFindMask | ( | TUint | aMask | ) |
Can be used in order to specify a combination of drive attributes that the drives to be searched must match.
When searching without specifying a mask, all drives, except the remote ones will be returned.
| aMask | The combination of drive attributes that we want the drives to match. |
(generated from Symbian Developer Library)