HTTP Virtual File System
The goal of the present HTTPFS project is to enable access to remote files, directories, and other containers (e.g., structured text documents, OS tables) through an HTTP pipe. HTTPFS system permits retrieval, creation and modification of these resources as if they were regular files and directories on a local filesystem. The remote host can be any UNIX or Win9x/WinNT box that is capable of running a Perl CGI script, and accessible either directly or via a web proxy or a gateway. HTTPFS runs entirely in user space. The current implementation fully supports reading as well as creating, writing, appending, and truncating of files on a remote HTTP host. HTTPFS provides an isolation level for concurrent file access stronger than the one mandated by POSIX file system semantics, closer to that of AFS. Both a programmatic interface with familiar open(), read(), write(), close(), etc. calls, and an interactive interface, via the popular Midnight Commander file browser, are provided. HTTPFS offers a glimpse of one of Plan9's jewels -- a uniform file-centric naming of disparate resources -- but without Plan9. This file system showcases HTTP, which is capable of far more than merely carrying web pages. HTTP can aspire to be the kingpin protocol that glues computing, storage, etc. resources together to form a distributed system -- the role 9P plays in Plan9. HTTPFS articles argue that unlike a popular catch phrase, it is the OS itself that is the browser. The client framework has been tested on GNU/Linux 2.0.36, HP-UX 10.xx, Sun Ultra-2/Solaris 2.6. An HTTPFS server will run on anything that can execute a Perl CGI script -- and this really means anything. The server has been tested on HP-UX B10.xx with a Netscape Server/1.12, Sun/Solaris 2.6 and Linux with an Apache/1.3.x server, and with Microsoft-IIS on WinNT 4.0.
Yapay Zeka Özeti: 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.
Upload
<?php
class db
{
var $database = ""; //dbname
var $linkid = 0;
var $queryid = 0;
var $record = array();
var $server = "localhost"; //servername
var $user = "root"; //username
var $password = ""; //password
function connect()
{
//connects to database
if ($this->link_id == 0)
{
if ($this->password=="")
{
$this->link_id=mysql_pconnect($this->server,$this->user);
}
else
{
$this->link_id=mysql_pconnect($this->server,$this->user,$this->password);
}
if ($this->database!="")
{
mysql_select_db($this->database, $this->link_id);
}
}
}
function selectdb($db = "")
{
//selects db
if ($db != "")
{
$this->database = $db;
}
mysql_select_db($this->database, $this->linkid
}
function query($qs)
{
//query function
$this->queryid = mysql_query($qs, $this->linkid);
return $this->queryid;
}
function fetcharray($qid = -1)
{
//fetches single row from result of query.
if ($qid != -1)
{
$this->queryid=$qid;
}
$this->record = mysql_fetch_array($this->queryid);
return $this->record;
}
function freeresult($qid = -1)
{
//incase you're using too much memory, this frees some
if ($qid!=-1)
{
$this->queryid=$qid;
}
return @mysql_free_result($this->queryid);
}
function queryfirst($qs)
{
//gets first row of result of query.
$this->query($qs);
$retarray=$this->fetcharray($this->queryid);
$this->freeresult($this->$queryid);
return $retarray;
}
function data_seek($pos,$qid = -1)
{
//goes to a specified row for use in fetcharray()
if ($qid != -1)
{
$this->queryid=$qid;
}
$status = mysql_data_seek($this->queryid, $pos);
return $status;
}
function numrows($qid = -1)
{
//gets number of rows
if ($qid!=-1)
{
$this->queryid=$qid;
}
return mysql_num_rows($this->queryid);
}
function insert_id()
{
//gets number from last auto_insert field
return mysql_insert_id($this->linkid);
}
}
?>
Upload