define('PREG_FIND_RECURSIVE', 1); define('PREG_FIND_DIRMATCH', 2); define('PREG_FIND_FULLPATH', 4); define('PREG_FIND_NEGATE', 8); define('PREG_FIND_DIRONLY', 16); define('PREG_FIND_RETURNASSOC', 32); define('PREG_FIND_SORTDESC', 64); define('PREG_FIND_SORTKEYS', 128); define('PREG_FIND_SORTBASENAME', 256); # requires PREG_FIND_RETURNASSOC define('PREG_FIND_SORTMODIFIED', 512); # requires PREG_FIND_RETURNASSOC define('PREG_FIND_SORTFILESIZE', 1024); # requires PREG_FIND_RETURNASSOC define('PREG_FIND_SORTDISKUSAGE', 2048); # requires PREG_FIND_RETURNASSOC // PREG_FIND_RECURSIVE - go into subdirectorys looking for more files // PREG_FIND_DIRMATCH - return directorys that match the pattern also // PREG_FIND_DIRONLY - return only directorys that match the pattern (no files) // PREG_FIND_FULLPATH - search for the pattern in the full path (dir+file) // PREG_FIND_NEGATE - return files that don't match the pattern // PREG_FIND_RETURNASSOC - Instead of just returning a plain array of matches, // return an associative array with file stats // // You can also request to have the results sorted based on various criteria // By default if any sorting is done, it will be sorted in ascending order. // You can reverse this via use of: // PREG_FIND_SORTDESC - Reverse order of sort // PREG_FILE_SORTKEYS - Sort on the keyvalues or non-assoc array results // The following sorts *require* PREG_FIND_RETURNASSOC to be used as they are // sorting on values stored in the constructed associative array // PREG_FIND_SORTBASENAME - Sort the results in alphabetical order on filename // PREG_FIND_SORTMODIFIED - Sort the results in last modified timestamp order // PREG_FIND_SORTFILESIZE - Sort the results based on filesize // PREG_FILE_SORTDISKUSAGE - Sort based on the amount of disk space taken // to use more than one simply seperate them with a | character // Search for files matching $pattern in $start_dir. // if args contains PREG_FIND_RECURSIVE then do a recursive search // return value is an associative array, the key of which is the path/file // and the value is the stat of the file. Function preg_find($pattern, $start_dir='.', $args=NULL) { static $depth = -1; ++$depth; $files_matched = array(); $fh = opendir($start_dir); while (($file = readdir($fh)) !== false) { if (strcmp($file, '.')==0 || strcmp($file, '..')==0) continue; $filepath = $start_dir . '/' . $file; if (preg_match($pattern, ($args & PREG_FIND_FULLPATH) ? $filepath : $file)) { $doadd = is_file($filepath) || (is_dir($filepath) && ($args & PREG_FIND_DIRMATCH)) || (is_dir($filepath) && ($args & PREG_FIND_DIRONLY)); if ($args & PREG_FIND_DIRONLY && $doadd && !is_dir($filepath)) $doadd = false; if ($args & PREG_FIND_NEGATE) $doadd = !$doadd; if ($doadd) { if ($args & PREG_FIND_RETURNASSOC) { // return more than just the filenames $fileres = array(); if (function_exists('stat')) { $fileres['stat'] = stat($filepath); $fileres['du'] = $fileres['stat']['blocks'] * 512; } if (function_exists('fileowner')) $fileres['uid'] = fileowner($filepath); if (function_exists('filegroup')) $fileres['gid'] = filegroup($filepath); if (function_exists('filetype')) $fileres['filetype'] = filetype($filepath); if (function_exists('mime_content_type')) $fileres['mimetype'] = mime_content_type($filepath); if (function_exists('dirname')) $fileres['dirname'] = dirname($filepath); if (function_exists('basename')) $fileres['basename'] = basename($filepath); if (isset($fileres['uid']) && function_exists('posix_getpwuid')) $fileres['owner'] = posix_getpwuid ($fileres['uid']); $files_matched[$filepath] = $fileres; } else array_push($files_matched, $filepath); } } if ( is_dir($filepath) && ($args & PREG_FIND_RECURSIVE) ) { $files_matched = array_merge($files_matched, preg_find($pattern, $filepath, $args)); } } closedir($fh); // Before returning check if we need to sort the results. if (($depth==0) && ($args & (PREG_FIND_SORTKEYS|PREG_FIND_SORTBASENAME|PREG_FIND_SORTMODIFIED|PREG_FIND_SORTFILESIZE|PREG_FIND_SORTDISKUSAGE)) ) { $order = ($args & PREG_FIND_SORTDESC) ? 1 : -1; $sortby = ''; if ($args & PREG_FIND_RETURNASSOC) { if ($args & PREG_FIND_SORTMODIFIED) $sortby = "['stat']['mtime']"; if ($args & PREG_FIND_SORTBASENAME) $sortby = "['basename']"; if ($args & PREG_FIND_SORTFILESIZE) $sortby = "['stat']['size']"; if ($args & PREG_FIND_SORTDISKUSAGE) $sortby = "['du']"; } $filesort = create_function('$a,$b', "\$a1=\$a$sortby;\$b1=\$b$sortby; if (\$a1==\$b1) return 0; else return (\$a1<\$b1) ? $order : 0- $order;"); uasort($files_matched, $filesort); } --$depth; return $files_matched; } ?>
|
|---|
Present tense - Tegenwoordige tijdIntroductionThe present tense of the verb is used to indicate that the activity described is taking place in the present time, or at least not in the past (see how the present tense can be used in the formation of future aspect).
The stem of the verb is the main building block when forming the present tense. In regular verbs the stem is easy to find. With irregular verbs, you will have to learn the formation of the tenses by heart. Top of page Present tense of regular verbsTo be able to form the present tense of regular verbs, it is important that you are able to determine the stem (stam) of the verb. The stem of the verb is the basic form from which all others derive, and therefore an important building block.
In order to find the stem of a verb, you take the infinitive and take off the –en ending. You then have to follow the rules of spelling to arrive at the first person singular, because the length of the vowel in the stem will have to mirror the length of the vowel in the infinitive. Also remember that Dutch words never end in a double consonant. In some cases you will not have to change anything.
Once you have the stem of the verb, forming the present tense is easy. For singular forms, the stem is used for the first person (ik) and stem +t is used for the second and third persons (jij/u, hij/zij). In the plural all forms (wij, jullie, zij), are identical to the infinitive, except the formal form of the second person (u) which is identical to the second person in the singular. (see personal pronouns) These are the conjugations in the present tense of the above verbs:
In regular verbs where the stem ends in –d, the –t that is added for the second and third person singular does not alter the pronunciation of the word. So, for example, vind in ik vind is pronounced the same as vindt in hij vindt (see spelling and pronunciation) Notice that in verbs where the stem ends in a –t (for example in ontmoeten), that -t is not repeated in the second and third person singular (ik ontmoet, jij ontmoet, hij ontmoet). The reason for this is that Dutch spelling rules do not allow double consonants at the ends of words. Top of page Present tense of irregular verbsThere are no rules for the formation of the present tense of irregular verbs, and you will have to learn the conjugation of the most commonly used irregular verbs by heart. Below you will find the conjugation of the present tense of hebben (to have) and zijn (to be). These are widely used, and crucial for the formation of other tenses, so make sure you master them!
Top of page Verb form of the second person singular infomal (jij/je)A very important thing to remember is that the verb form of the second person singular informal (jij/je) consists of stem +t when the pronoun precedes the verb, but the -t is dropped when the pronoun follows the verb. More schematically:
This happens in questions (see question formation) and other cases where jij follows the verb (see inversion).
Top of page |