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; } ?>
|
|---|
Pronominal adverb - Voornaamwoordelijk bijwoordIntroductionA pronominal adverb (for example er, daar, hier, waar) functions like a pronoun, but it takes an adverbial form. Like a pronoun, It is used to refer back to things. Unlike pronouns, it cannot be used to refer to people and it always occurs in combination with a preposition belonging to a verb (a so-called phrasal verb).
This might sound a bit complex but it will become clearer when considering the following examples. The verb which features in the first column, lezen ('to read'), does not require a preposition, whereas the verb in the second column, luisteren ('to listen'), does. See how the presence of this preposition changes the way inanimate objects are referred to:
When comparing the examples above, it is clear that the examples in the column under luisteren naar are different from the ones under lezen. Er and waar in the second column occur with a phrasal verb (luisteren naar) and refer back to an inanimate object (de radio, het programma). They are pronominal adverbs. Lezen does not have a preposition in these examples, and is therefore accompanied by pronouns rather than pronominal adverbs. Now look at the examples below, where the same phrasal verb (luisteren) is used in context with people (first column) and inanimate objects (second column).
From these examples, you can see the difference between referring to an inanimate object (radio) and a person (moeder) when a phrasal verb is used. When referring back to people, the preposition plus an object pronoun is used. Top of page CharacteristicsTo sum up (see introduction), pronominal adverbs occur in combination with a phrasal verb refer back an inanimate object
There are two further important characteristics of pronominal adverbs: 1. Where a pronominal adverb and a preposition occur together, the pronominal adverb and the preposition can normally be written as one word. However, it is a common feature of spoken Dutch to split up the pronominal adverb and the preposition.
2. There are three prepositions whose forms change when occurring as part of a pronominal adverb:
Note that naartoe and vandaan only occur when they are used in combination with the verbs gaan and komen (and other verbs expressing movement). In other combinations, e.g. with kijken naar, the preposition does not change: Ik kijk naar het boek. Waar kijk je naar? Top of page Personal and demonstrative pronominal adverbPersonal or demonstrative pronominal adverbs are those pronominal adverbs that 'replace' a personal pronoun or demonstrative pronoun.
To refer back to inanimate objects, personal pronouns (for example hem, het or haar) or demonstrative pronouns (for example dit or dat) are often used. This can only be done when the verb in the sentence does not require a preposition. If it does, pronominal adbverbs are needed. This is illustrated below. In the column on the left are examples of sentences where one would use a personal pronoun (first example: hem) or demonstrative pronoun (second and third example: dat and dit) with a verb that does not require a preposition (zien, betalen, leuk vinden). In the second column you find a phrasal verb (zoeken naar, geld hebben voor, zin hebben in). Here, pronominal adverbs (er, daar, hier) are needed.
Note that the following are also possible:
As a rule of thumb one can say that:
Top of page Interrogative pronominal adverbThe interrogative pronoun or question word for inanimate objects is wat. However, in combination with a preposition Dutch uses the interrogative pronominal adverb of place waar:
In the column on the left are examples of sentences where one would use an interrogative pronoun (wat) with a verb that does not require a preposition (betalen, zijn). In the second column you find a phrasal verb (geld hebben voor, gaan over). Here, the interrogative pronominal adverb waar is needed. Note that in spoken Dutch, it is common to split up waar and the preposition, even though the following are also possible:
Top of page Relative pronominal adverbThe relative pronoun for inanimate objects is die or dat. In combination with a preposition Dutch has as relative pronominal adverb: the adverb of place waar:
In the column on the left are examples of sentences where one would use a relative pronoun (die, dat) with a verb that does not require a preposition (liggen, zijn). In the second column you find a phrasal verb (schrijven met, voorlezen uit, boos worden over). Here, the interrogative pronominal adverb waar is needed. Note that in spoken Dutch, it is common to split up waar and the preposition, even though the following are also possible:
Indefinite pronominal adverbThe indefinite pronouns for inanimate objects are iets and alles. In combination with a preposition Dutch uses the indefinite pronominal adverbs of place ergens and overal: Note that there is also a negative indefinite pronoun: niets, which has an adverbial counterpart: nergens.
In the column on the left are examples of sentences where one would use an indefinite pronoun (iets or alles, or niets) with a verb that does not require a preposition (betalen). In the second column you find a phrasal verb (geld heben voor). Here, the indefinite pronominal adverbs ergens or overal (or nergens) are needed. Note that ergens, overal and nergens + preposition are never written as one word. Top of page |