xref: /freebsd/usr.sbin/fdwrite/fdwrite.1 (revision 8ccc0d235c226d84112561d453c49904398d085c)
1.\"
2.\" ----------------------------------------------------------------------------
3.\" "THE BEER-WARE LICENSE" (Revision 42):
4.\" <phk@FreeBSD.org> wrote this file.  As long as you retain this notice you
5.\" can do whatever you want with this stuff. If we meet some day, and you think
6.\" this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
7.\" ----------------------------------------------------------------------------
8.\"
9.\"
10.Dd November 16, 2025
11.Dt FDWRITE 1
12.Os
13.Sh NAME
14.Nm fdwrite
15.Nd format and write floppy disks
16.Sh SYNOPSIS
17.Nm
18.Op Fl v
19.Op Fl y
20.Op Fl f Ar inputfile
21.Op Fl d Ar device
22.Sh DEPRECATION NOTICE
23.Nm
24is deprecated and may not be present in
25.Fx 16.0
26and later.
27.Sh DESCRIPTION
28The
29.Nm
30utility formats and writes one and more floppy disks.
31Any floppy disk device capable of formatting can be used.
32.Pp
33The
34.Nm
35utility will ask the user
36(on
37.Pa /dev/tty )
38to insert a new floppy and press return.
39The device will then be opened, and queried for its parameters,
40then each track will be formatted, written with data from the
41.Ar inputfile ,
42read back and compared.
43When the floppy disk is filled, the process is repeated, with the next disk.
44This continues until the program is interrupted or EOF is encountered on the
45.Ar inputfile .
46.Pp
47The options are as follows:
48.Bl -tag -width 10n -offset indent
49.It Fl v
50Toggle verbosity on stdout.
51Default is ``on''.
52After
53.Ar device
54is opened first time the format will be printed.
55During operation progress will be reported with the number of tracks
56remaining on the current floppy disk, and the letters I, Z, F, W,
57R and C, which indicates completion of Input, Zero-fill, Format
58Write, Read and Compare of current track respectively.
59.It Fl y
60Do not ask for presence of a floppy disk in the drive.
61This non-interactive flag
62is useful for shell scripts.
63.It Fl f Ar inputfile
64Input file to read.
65If none is given, stdin is assumed.
66.It Fl d Ar device
67The name of the floppy device to write to.
68Default is
69.Pa /dev/fd0 .
70.El
71.Pp
72The
73.Nm
74utility actually closes the
75.Ar device
76while it waits for the user to press return,
77it is thus quite possible to use the drive for other purposes at this
78time and later resume writing with the next floppy.
79.Pp
80The parameters returned from
81.Ar device
82are used for formatting.
83If custom formatting is needed, please use
84.Xr fdformat 8
85instead.
86.Sh EXAMPLES
87The
88.Nm
89utility
90was planned as a tool to make life easier when writing a set of floppies,
91one such use could be to write a tar-archive:
92.Pp
93.Dl tar cf - . | gzip -9 | fdwrite -d /dev/fd0.1720 -v
94.Pp
95The main difference from using
96.Xr tar 1 Ns 's
97multivolume facility is of course the formatting of the floppies, which
98here is done on the fly,
99thus reducing the amount of work for the floppy-jockey.
100.Sh SEE ALSO
101.Xr fdformat 8
102.Sh HISTORY
103The
104.Nm
105utility was written while waiting for ``make world'' to complete.
106Some of the code was taken from
107.Xr fdformat 8 .
108.Sh AUTHORS
109The program has been contributed by
110.An Poul-Henning Kamp Aq Mt phk@FreeBSD.org .
111.Sh BUGS
112Diagnostics are less than complete at present.
113.Pp
114If a floppy is sick, and the
115.Ar inputfile
116is seekable, it should ask the user to frisbee the disk, insert
117another, and rewind to the right spot and continue.
118.Pp
119This concept could be extended to cover non-seekable input also
120by employing a temporary file.
121.Pp
122An option (defaulting to zero) should allow the user to ask for
123retries in case of failure.
124.Pp
125At present a suitable tool for reading back a multivolume set
126of floppies is missing.
127Programs like
128.Xr tar 1
129for instance, will do the job, if the data has not been compressed.
130One can always trust
131.Xr dd 1
132to help out in this situation of course.
133