ftpfs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. .TH FTPFS 4
  2. .SH NAME
  3. ftpfs \- file transfer protocol (FTP) file system
  4. .SH SYNOPSIS
  5. .B ftpfs
  6. [
  7. .B -/dqnt
  8. ]
  9. [
  10. .B -m
  11. .I mountpoint
  12. ]
  13. [
  14. .B -a
  15. .I password
  16. ]
  17. [
  18. .B -e
  19. .I ext
  20. ]
  21. [
  22. .B -k
  23. .I keyspec
  24. ]
  25. [
  26. .B -o
  27. .I os
  28. ]
  29. [
  30. .B -r
  31. remoteroot
  32. ]
  33. .I system
  34. .SH DESCRIPTION
  35. .I Ftpfs
  36. dials the TCP file transfer protocol (FTP) port, 21, on
  37. .I system
  38. and mounts itself (see
  39. .IR bind (2))
  40. on
  41. .I mountpoint
  42. (default
  43. .BR /n/ftp )
  44. to provide access via FTP to files on the remote machine.
  45. .I Ftpfs
  46. attempts to use FTP's `passive' mode
  47. but falls back to using `active' mode if that fails.
  48. If required by the remote machine,
  49. .I ftpfs
  50. will ask
  51. .IR factotum (4)
  52. for a key matching the pattern
  53. .IP
  54. .EX
  55. proto=pass service=ftp server=\fIsystem\fP user? !password? \fIkeyspec\fP
  56. .EE
  57. .PP
  58. (If
  59. .I factotum
  60. does not have such a key,
  61. .I factotum
  62. will prompt the user for one.)
  63. .PP
  64. The user names
  65. .B ftp
  66. and
  67. .B anonymous
  68. conventionally offer guest/read-only access to
  69. machines.
  70. Anonymous FTP may be called without using factotum
  71. by using the
  72. .B -a
  73. option and specifying the
  74. .IR password .
  75. .PP
  76. By default the file seen at the mount point is the user's
  77. remote home directory if he has one.
  78. The option
  79. .B -/
  80. forces the mount point to correspond to the
  81. remote root.
  82. The option
  83. .B -r
  84. forces the mount point to correspond to the
  85. remote directory
  86. .IR remoteroot .
  87. .PP
  88. To avoid seeing startup messages from the server use option
  89. .BR -q .
  90. To see all messages from the server use option
  91. .BR -d .
  92. .PP
  93. Some systems will hangup an ftp connection that has no activity
  94. for a given period. The
  95. .BR -K
  96. option causes ftp to send a NOP command every 15 seconds to attempt
  97. to keep the connection open. This command can cause some servers to
  98. hangup, so you'll have to feel your way.
  99. .PP
  100. The
  101. .B -t
  102. option causes
  103. .I ftpfs
  104. to negotiate TLS encryption with the server.
  105. .PP
  106. To terminate the connection,
  107. .B unmount
  108. (see
  109. .IR bind (1))
  110. the mount point.
  111. .PP
  112. Since there is no specified format for metadata retrieved
  113. in response to an FTP directory request,
  114. .I ftpfs
  115. has to apply heuristics to steer the interpretation. Sometimes,
  116. though rarely, these heuristics fail. The following options are
  117. meant as last resorts to try to steer interpretation.
  118. .PP
  119. A major clue to the heuristics is the operating system at the other
  120. end. Normally this can be determined automatically using the
  121. FTP SYST command. However, in some cases the server doesn't implement
  122. the SYST command. The
  123. .B -o
  124. option will force the case by specifying the name of the operating
  125. system. Known system types are:
  126. .BR UNIX ,
  127. .BR SUN ,
  128. .BR TOPS ,
  129. .BR Plan9 ,
  130. .BR VM ,
  131. .BR VMS ,
  132. .BR MVS ,
  133. .BR NetWare ,
  134. .BR OS/2 ,
  135. .BR TSO ,
  136. and
  137. .BR WINDOWS_NT .
  138. .PP
  139. Some systems and/or FTP servers return directory listings that don't
  140. include the file extension. The
  141. .B -e
  142. option allows the user to specify an extension to append to all
  143. remote files (other than directories).
  144. .PP
  145. Finally, there are two FTP commands to retrieve the contents of a
  146. directory, LIST and NLST. LIST is approximately equivalent to
  147. .L ls -l
  148. and NLST to
  149. .LR ls .
  150. .I Ftpfs
  151. normally uses LIST. However, some FTP servers interpret LIST
  152. to mean, give a wordy description of the file.
  153. .I Ftpfs
  154. normally notices this and switches to using NLST. However, in
  155. some rare cases, the user must force the use of NLST with the
  156. .B -n
  157. option.
  158. .SH EXAMPLE
  159. You want anonymous FTP access to the system
  160. .BR export.lcs.mit.edu .
  161. The first
  162. .IR import (4)
  163. command is only necessary if your machine does not have access to the
  164. desired system, but another, called
  165. .B gateway
  166. in this example, does.
  167. .IP
  168. .EX
  169. import gateway /net
  170. ftpfs -a yourname@yourmachine export.lcs.mit.edu
  171. .EE
  172. .SH SOURCE
  173. .B /sys/src/cmd/ip/ftpfs
  174. .SH "SEE ALSO"
  175. .IR bind (2)
  176. .SH BUGS
  177. Symbolic links on remote Unix systems will always have mode 0777
  178. and a length of 8.
  179. .PP
  180. After connecting to a TOPS-20 system, the mount point will contain
  181. only one directory, usually
  182. .BR /n/ftp/PS:<ANONYMOUS> .
  183. However, walking to any valid directory on that machine will succeed
  184. and cause that directory entry to appear under the mount point.
  185. .PP
  186. .I Ftpfs
  187. caches files and directories. A directory will fall from the cache
  188. after 5 quiescent minutes or if the local user changes the
  189. directory by writing or removing a file.
  190. Otherwise, remote
  191. changes to the directory that occur after the directory has
  192. been cached might not be immediately visible.
  193. Attempting to walk to
  194. .IB directory /.flush.ftpfs
  195. will flush
  196. .I directory
  197. from the cache, thus forcing
  198. .I ftpfs
  199. to re-read it.
  200. .PP
  201. There is no way to issue the appropriate commands to handle special synthetic
  202. FTP file types such as directories
  203. that automatically return a
  204. .B tar
  205. of their contents.
  206. .PP
  207. .I Ftpfs
  208. makes copies in
  209. .B /tmp
  210. of files being transferred,
  211. so its effects might not be immediate.
  212. If there is enough main memory, you might want to run
  213. .IR ramfs (4)
  214. first.
  215. .PP
  216. Filenames containing spaces will confuse
  217. .I ftpfs
  218. (and other FTP clients).