FTOOLS FITS Filename Filetypes DESCRIPTION The type of file specifies the medium on which the file is located (eg, disk or network) and, hence, how to access the file. Currently supported types are file:// - file on local magnetic disk (default) ftp:// - a readonly file accessed with the anonymous FTP protocol. It also supports ftp://username:password@hostname/... for accessing password-protected ftp sites. http:// - a readonly file accessed with the HTTP protocol. It does not support username:password like the ftp driver. root:// - uses the CERN root protocol for writing as well as reading files over the network. shmem:// - opens or creates a file which persists in the computer's shared memory. mem:// - opens a temporary file in core memory. The file disappears when the program exits so this is mainly useful for test purposes when a permanent output file is not desired. If the filetype is not specified, then type file:// is assumed. The double slashes '//' are optional and may be omitted in most cases. Notes about the shmem filetype: Shared memory files are currently supported on most Unix platforms, where the shared memory segments are managed by the operating system kernel and 'live' independently of processes. They are not deleted (by default) when the process which created them terminates, although they will disappear if the system is rebooted. Applications can create shared memory files by specifying a filename of the form 'shmem://h2' where the root `file' names are currently restricted to be 'h0', 'h1', 'h2', 'h3', etc., up to a maximumn number of 16. This is a preliminary implementation of the shared memory interface. A more robust interface, which will have fewer restrictions on the number of files and on their names, is planned for the future. This FITS file can then be opened by subsequent applications by using the identical file name (e.g., 'shmem://h2'). Depending on the application, the file may be opened with either READWRITE or READONLY access just as with disk files. More than one process can operate on READONLY mode files at the same time. Because filelocking is supported (both in READONLY and READWRITE modes), attempts to open the file may be locked out until another process closes the file. A shared memory management utility program called `smem', is included with the CFITSIO distribution. It can be built by typing `make smem'; then type `smem -h' to get a list of valid options. Executing smem without any options causes it to list all the shared memory segments currently residing in the system and managed by the shared memory driver. To get a list of all the shared memory objects, run the system utility program `ipcs [-a]'. Notes about the root filetype The original rootd server can be obtained from: ftp://root.cern.ch/root/rootd.tar.gz but, for it to work correctly with CFITSIO one has to use a modified version which supports a command to return the length of the file. This modified version is available in rootd subdirectory in the CFITSIO ftp area at ftp://legacy.gsfc.nasa.gov/software/fitsio/c/root/rootd.tar.gz. This small server is started either by inetd when a client requests a connection to a rootd server or by hand (i.e. from the command line). The rootd server works with the ROOT TNetFile class. It allows remote access to ROOT database files in either read or write mode. By default TNetFile assumes port 432 (which requires rootd to be started as root). To run rootd via inetd add the following line to /etc/services: rootd 432/tcp and to /etc/inetd.conf, add the following line: rootd stream tcp nowait root /user/rdm/root/bin/rootd rootd -i Force inetd to reread its conf file with "kill -HUP ". You can also start rootd by hand running directly under your private account (no root system priviliges needed). For example to start rootd listening on port 5151 just type: rootd -p 5151 Notice: no & is needed. Rootd will go into background by itself. Rootd arguments: -i says we were started by inetd -p port# specifies a different port to listen on -d level level of debug info written to syslog 0 = no debug (default) 1 = minimum 2 = medium 3 = maximum Rootd can also be configured for anonymous usage (like anonymous ftp). To setup rootd to accept anonymous logins do the following (while being logged in as root): - Add the following line to /etc/passwd: rootd:*:71:72:Anonymous rootd:/var/spool/rootd:/bin/false where you may modify the uid, gid (71, 72) and the home directory to suite your system. - Add the following line to /etc/group: rootd:*:72:rootd where the gid must match the gid in /etc/passwd. - Create the directories: mkdir /var/spool/rootd mkdir /var/spool/rootd/tmp chmod 777 /var/spool/rootd/tmp Where /var/spool/rootd must match the rootd home directory as specified in the rootd /etc/passwd entry. - To make writeable directories for anonymous do, for example: mkdir /var/spool/rootd/pub chown rootd:rootd /var/spool/rootd/pub That's all. Several additional remarks: you can login to an anonymous server either with the names "anonymous" or "rootd". The password should be of type user@host.do.main. Only the @ is enforced for the time being. In anonymous mode the top of the file tree is set to the rootd home directory, therefore only files below the home directory can be accessed. Anonymous mode only works when the server is started via inetd. SEE ALSO filenames