[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cp --archive with special files
From: |
Mike Frysinger |
Subject: |
cp --archive with special files |
Date: |
Thu, 28 Jun 2007 05:57:20 -0400 |
User-agent: |
KMail/1.9.7 |
a user just pointed out this corner case with -a which i think is a bug ...
seems to happen with any special file (fifo, device node, etc...), but it was
first noticed with a device node
# mkdir src dst
# touch dst/null
# mknod src/null c 1 3
# cp -a src/* dst/
cp: cannot create special file `d/null': File exists
# cp -a s/null d/null -f
cp: cannot create special file `d/null': File exists
# ls -l d/null
-rw-r--r-- 1 root root 0 2007-06-28 05:41 d/null
i think in the case where cp encounters the destination as being a regular
file and the source as being a special file, it should simply unlink the
destination and create the destination the same as if it didnt exist in the
first place
-mike
signature.asc
Description: This is a digitally signed message part.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- cp --archive with special files,
Mike Frysinger <=