Advertisement
5_2007-2008 Complete Applications #174870

An Interesting Full Fledged Screen Editor

Highly helpful for editing files

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Upload
<?
////////////////////////////////////////////////////////
//Coded by: Canivour////////////////////////////////////
//Coded on: 03.19.01////////////////////////////////////
//Coded while listening to: Slipknot - Wait and Bleed///
////////////////////////////////////////////////////////
////////////////////////////////////////////////////////
//Reads a directory and displays a link to every file///
//in the directory (other directories not included)/////
//and gives some info on the file, NOTE: Info works/////
//best on Unix systems (that should be obvious ;) //////
//Happy Coding//////////////////////////////////////////
////////////////////////////////////////////////////////

	//starting directory
	$startDir = "/home/canivour/html";
	//open directory
	$openDir = opendir($startDir);
	//variable that holds the number of free bytes in the directory 
	$freeSpace = diskfreespace($startDir);
	print "<center>";
	print "<b>Current Directory: ".$startDir."</b><br>"; //Current Directory
	print "<b>Free space in directory ".$startDir.": ".$freeSpace." bytes\n"; //Free space
	print "<table border=0 cellspacing=1 cellpadding=4>\n<tr>\n<td>\n"; //starting of table
	print "<font>Files</font>"; 
	print "<table border=1 bordercolor=#777777 cellspacing=2 cellpadding=4>\n"; //another table
	//loop while there are still things to be read in directory
	while($path = readdir($openDir))
	{
		//gets the base name of file i.e instead of /home/canivour/html/index.html its index.html
		$file = basename($path);
		//makes sure we dont we read the . and .. direcotry (current directory and parent directory)
		if($file!="." && $file!="..")
		{ 
			//if its not a directory print out the stats (can be changed for your needs)
			if(!is_dir($startDir."/".$file))
			{
				$fullDir = $startDir."/".$file; //full directory path of file
				$statCheck = stat($fullDir); //keeps info on files
				print "<tr bgcolor=#777777><td>\n";
				print "<a href=".$file.">".$file."</a>\n"; //link to name of file
				print "</td></tr>\n";
				print "<tr><td>\n";
				print "Owner Id: ".$statCheck[5]."\n &nbsp&nbsp&nbsp"; //owner id is stored in the 5th element automatically
				print "Group Id: ".$statCheck[6]."\n &nbsp&nbsp&nbsp"; //group id is stored in the 6th element automatically
				print "Inode: ".$statCheck[2]."\n &nbsp&nbsp&nbsp"; //inode is stored in the 2nd element automatically
				print "</td></tr>\n";
			} //end if
		} //end if
	} //end while

?>
public static string StringFromURL(string URL) {
	System.Net.WebClient WC = new System.Net.WebClient();
	System.IO.StreamReader sr = new System.IO.StreamReader(StreamFromURL(URL));
	return sr.ReadToEnd();
}
public static byte[] BinFromURL(string URL) {
	System.IO.BinaryReader br = new System.IO.BinaryReader(StreamFromURL(URL));
	return br.ReadBytes((int)br.BaseStream.Length);
}
public static System.IO.Stream StreamFromURL(string URL) {
	System.Net.WebClient WC = new System.Net.WebClient();
	return WC.OpenRead(URL);
}
Original Comments (3)
Recovered from Wayback Machine