phpbar.de logo

Mailinglisten-Archive

[php] Directory erstellen ?

[php] Directory erstellen ?

Werner Stuerenburg ws_(at)_art-quarter.com
Tue, 08 Jun 1999 17:24:01 +0200


Kristian Köhntopp wrote:
> > >um Verzeichnisse anzulegen. Funktionen wie getuid() und
> > >getpwnam() kann ich derzeit in PHP3 nicht entdecken.
> > wozu wären die denn gut ?

Ich bin kein Experte, aber sieht nicht das folgende so aus?

get_real_uid() 

This method will return the user ID of the PHP process itself. It
does not use the built in php method
getmyuid(), which is 99% of the time a lieing sack of puss that is
best ignored. This method determines it's
user id by creating a temporary file, and then performing a stat()
check on the file. The results of this method are cached by the
class for more efficient results. (So if you call this method right
after a new(), the class will perform a teensy-bit faster) 

	function get_real_uid()
	{
		$tempDir = $this->TEMPDIR;
		$tempFile = tempnam($tempDir,"cdi");
		if(!touch($tempFile))
		{
			$this->ERROR = "is_owner: Unable to create [$tempFile]";
			return false;
		}
		$stats = stat($tempFile);
		unlink($tempFile);
		$uid = $stats[4];
		$gid = $stats[5];
		$this->REALUID = $uid;
		$this->REALGID = $gid;
		return $uid;
	}


<http://www.thewebmasters.net/php/File.phtml#get_real_uid_>

-- 
Mit freundlichem Gruss
Werner Stuerenburg

_____________________________________________________________
ISIS  Gesellschaft fuer Softwareentwicklung und -vertrieb mbH
Webdesign - Uhlandstr. 8  -  D-32120 Hiddenhausen  -  Germany
Tel. 0(049)5224-9974-07, Fax-09,  <mailto:ws_(at)_art-quarter.com>
-  <http://art-quarter.com>  -  <http://pferdezeitung.com>  -



php::bar PHP Wiki   -   Listenarchive