I've just exchanged tape drives between machines (both Unix Tru64). The device files aren't working now, and I have to do some work with them (will generate a different question). I created a directory to store the old device files to, but the cp command is treating them like device files and won't just let me copy them.
How do I copy the device files to another directory as text?
STOP.
Do nothing further until you fully understand what device special files are, what they mean to the operating system, and how they are created/managed. (hint:
mknod
-- this will probably help you fix your other problem too)In brief, a device file is an interface for sending commands/data to a device's driver, and receiving information back from it.
It is not a regular file containing data to be copied, moved, or otherwise manipulated in the usual way.
With your newfound understanding of what device files are it should be clear that you CAN NOT simply "copy a device file to another directory as text" -- That's not how they work.
If you do copy a device file you're simply copying a pointer to the driver: Change tapes and the data is going to be different.
Thus to copy the contents of a "tape device file" makes no sense -- what you want is to copy the data off the tape. To do that you need to send commands to the tape device to give you all of its data, and then store that as a regular file somewhere else. The
tar
orcpio
commands can be useful here, but there are other options.