I had been using Ubuntu for a period of time, and had faced this problem:
I am using ubuntu 14.10 right now and have Steam installed in my /home/user/.steam
folder. When i was copying the .steam
folder in my home directory and the progress bar was near the end it says a message indicating "Can't copy a special file steam.pipe", more or less sounds like that.
I had faced this problem since using Ubuntu 14.04, but i know this is not distro / release issue but rather a file copying problem. Fortunately I can manage this problem by using command in my .steam
folder:
sudo cp -f ./steam.pipe /[destination]
Eventually, just by this day, i can't copy this file using the command above. The terminal just stuck at:
Idad@IdadComp:/home/Idad/.steam$sudo cp -f ./steam.pipe /[destination]
and did not back to
Idad@IdadComp:/home/Idad/.steam$
indicating that the copy process not done.
My question is, how could i copy this steam.pipe file?
I had tried:
- Running nautilus in super user mode, but still failed.
- Try to compress and decompress this file at destination folder, but error at decompressing
steam.pipe
file. - And also read this link How to copy or (quickly-and-easily) backup a "special file"?, but gained no result.
Thanks in advance for your help. 🙂
Best Answer
As muru says, you shouldn't have to back up
steam.pipe
. Steam should be able to re-create it if it is missing. However, when backing up your~/.steam
folder, you should check if you also have a~/.local/share/Steam
folder. If so, you'll probably want to back it up too. It usually contains most of the files associated with a Steam installation, including your installed Steam games.I have written the rest of this answer in case:
cp
.steam.pipe
, in case you do ever need to do so.The executive summary is that you should use
rsync
for your backups. See below for details, explanation, and alterantives.Why
steam.pipe
Is Specialsteam.pipe
is a FIFO, a.k.a. a named pipe:FIFOs are not a regular files, but instead are special filesystem entries that one may interact with as though they are files. Writing to the FIFO stores data in memory, where it remains until the FIFO is read from. Reading from a FIFO obtains data in the order they were written (so it is First In, First Out).
Why You Had Trouble Copying It
There are actually two distinct behaviors that one might want, when attempting to copy a FIFO. Which one you want depends on the situation.
You tried two programs:
cp
reads data from the FIFO, rather than making a copy of the FIFO itself. If there are no data in the FIFO,cp
stalls until some process writes to it.Making Copies of Special Files (like FIFOs)
To duplicate a FIFO, you can use
rsync
with the--specials
flag:That's if you want to copy it separately. To copy a whole folder for archival purposes--that is, where you want most things to be the way they were before, so it works properly when restored--you can use
rsync -a
:For more information about
rsync
, see "rsync" in the Ubuntu help wiki, the upstream rsync website, andman rsync
(which explains specifically what the-a
flag does).cp
is well suited for simple use cases, but I suggestrsync
for making backups.Specials Can Be Archived, Too
Another way to back up a folder is to make an archive of it with
tar
, and that will also automatically preserve FIFOs (i.e., they will be recreated on extraction):Re-making the FIFO Manually
If you were missing a FIFO (either in a backup, or in general) and need to restore it, you can just create a new one with
mkfifo
.You'll want to create it with the correct permissions. Running
ls -l
onsteam.pipe
shows a permissions mask ofprw-------
.p
just means it's a named pipe (FIFO). The rest means it's readable and writable by its owner and has no other permissions (see FilePermissions for details). The octal permissions mask is thus 600 (or 0600), so you'll want to pass-m 600
tomkfifo
:Duplicating a FIFO Doesn't Duplicate Its "Contents"
This is not a problem for backups, but you should know that duplicating a FIFO (for example, with
rsync
) just makes a new FIFO like it. If there are data in the FIFO ready to be read, the data will not be available in the new FIFO.The reason this is not a problem for backups is that FIFOs are not for long-term storage. They're not really even for storage at all. Data in a FIFO are not written to disk, and when a process writes to a FIFO, the write is not even reported to the process as successful until the data have been read. (Similarly, if a process reads from a FIFO with no data in it, the read will stall until data are written.)
You can see this in action, and also get a better sense of how FIFOs work, by making one of your own and experimenting with it. You can create a new FIFO
foo
with default permissions withmkfifo foo
, and redirect text to it with a command likeecho 'Hello, world!' > foo
. This will stall, as nothing has read the text yet. Then, in another terminal (e.g., another Terminal tab) read the text withcat foo
and see what happens in each terminal.