This is to announce an HTTP Virtual File System for Midnight Commander (MC). It is designed to "mount" any directory on a remote site, and view and copy files to/from/between remote or local directories. This is similar to a familiar NFS, or MC's own mcfs
and ftps
. Yet this VFS works via HTTP, requires minimum installation on a remote site (only a single, easily configurable sh-script), can work through firewalls, and has a number of other advantages, see below.
This article was posted on comp.os.linux.development.system, comp.infosystems.www.misc, comp.os.linux.misc, comp.os.research newsgroups on Monday, Feb 2 1998.
Note. The HTTP file system has been considerably extended and developed since this announcement. The system is no longer limited to the Midnight Commander, and can be used with any POSIX application or code. Consult an HTTP Virtual File System page for up-to-date information.
cd http:day-2^DeepestRoot^tmp
/tmp
directory of a remote (HP-UX) computer day-2
in a MC pane
day-2:/tmp
directory
cd http:mday-1
mday-1
(on the other side of a firewall)
day-2:/tmp
directory listed in one MC pane onto mday-1
listed on the other pane.
extfs
Virtual file system, which translates these orders into calls to external executables (passing them parameters and files to transmit/receive);
vfs-client
, one such executable, which further translates MC's orders into HTTP GET
or PUT
requests;
VFS-server.sh
, a CGI script running on a remote computer that executes the requests: lists directories on its own server, sends files, and accepts new content for old or newly created files.
VFS-server.sh
and vfs-client.cc
) tell precisely how orders get translated and executed, which HTTP requests are issued, and how they are replied to and acknowledged. BTW, the comments tell all about the DeepestRoot.VFS-server.sh
CGI script (which can be adjusted to run on WinNT and even on a Mac, if re-written in MacPerl).
Range
:), and If-Match:
, Keep-Alive
, etc. headers.
.htaccess
or conf/access.conf
) to trusted hosts/users, and/or demand authentication, in a regular HTTP way. These access restrictions are the responsibility of a httpd
; HTTPFS doesn't need to do anything special about them (and doesn't even need to be aware of them).
In addition, the VFS-server.sh
script may implement its own access control. For example, it may refuse PUT
requests. This effectively makes exported file systems read-only. The VFS-server.sh
script may permit modification/listing of only certain files. The script may disallow DeepestRoot
and "..
" in the file paths, thus restricting user access only to a specific part of the file system tree. The possibilities are endless.
INSTALL
file tells how to get things to work; HTTP-vfs.dr
tells what the other files are for. Note the package includes an implementation of TCP streams, and C++ code to parse (multi-part) MIME entities, HTTP headers and configuration files of several flavors. The latter are built on an efficient implementation of dictionaries and collections of strings (also included, along with the validation code).After all files are placed in the proper places, you can launch mc, and enter
cd http:myhost.com
or
cd http:myhost.com^DeepestRoot^tmp
where myhost.com is the remote host where you've installed a VFS-server.sh
CGI script. You can browse now a remote directory as if it were a local folder, view the files there and copy files to a local file system or other VFS. To copy files into a http VFS, you need to recompile Midnight Commander with a new version of extfs.c
(included in the present distribution).Please mail comments, questions, trouble reports to me directly at
oleg-at-okmij.org
http://okmij.org/ftp/DreamOS.htmlHowever, the HTTP VFS proves that it is all the other way around: the OS is the browser!
Indeed, consider what happens when you enter "cd http:remote.host
" in the MC, highlight an index.html
file and try to view it. The OS (MC in this case) opens a connection to the remote.host
, fetches the file, caches it locally, and launches lynx
in the local mode to interpret the HTML content of this local file. Thus a back-end of a web browser that deals with networking, caching, etc. becomes a part of the OS itself. Just as FTP, DNS, DHCP are all a part of the "standard TCP stack", so should HTTP. An HTML formatter, the front-end of a web browser, becomes therefore a mere viewer of a particular (HTML) content, just as xv
is a viewer of the image/gif
content, and less
is a default PAGER
of text/plain files.
extfs
wouldn't even let you copy files into an "archive" (let alone create new files there). I had to tinker with extfs.c
to make "archives" truly updatable. I have submitted the changes to MC development team.
Also, I have to think of http-vfs
as a part of the OS itself. I have a few ideas how to do all this. What I don't know is, if anything of what I wrote in this article is of any interest, appeal or even use; or I'm simply wasting mine and everyone else's time...
From oleg Mon Feb 2 12:07:11 1998 Subject: Announce: HTTP file system. Browser := OS; Midnight Commanding remote files Date: Mon, 02 Feb 1998 11:11:09 -0600 Keywords: HTTP, MC, VFS, CGI, browser, Web, OS, NFS, virtual file system, remote file system Message-ID: <886438688.518848522@DEJANEWS.COM> Newsgroups: comp.os.linux.development.system,comp.infosystems.www.misc,comp.os.linux.misc,comp.os.research Summary: an HTTP Virtual File System under Midnight Commander X-Article-Creation-Date: Mon Feb 02 16:58:08 1998 GMT
oleg-at-okmij.org or oleg-at-computer.org