[OT] Hardlinks and directories

Suvayu Ali fatkasuvayu+linux at gmail.com
Sat Feb 13 05:00:27 UTC 2010


On Friday 12 February 2010 07:45 PM, Patrick O'Callaghan wrote:
> On Fri, 2010-02-12 at 19:20 -0800, Suvayu Ali wrote:
>>> $ fg %1
>>> cat>  foo
>>> testing deleted files
>>> ^Z
>>> [1]+  Stopped                 cat>  foo
>>> $ lsof +L1 -s
>>> COMMAND  PID   USER   FD   TYPE DEVICE SIZE NLINK  NODE NAME
>>> cat     3843 jallad    1w   REG  253,2   22     0 15032 /home/jallad/foo (deleted)
>>> $ fg %1
>>> cat>  foo
>>> ^Z
>>> [1]+  Stopped                 cat>  foo
>
> As far as I can see, you didn't write any extra data on the second
> reconnection to cat, and the size (22 bytes) hasn't changed. Why do you
> think there's something wrong with this?

I was expecting to see something like this on the 2nd reconnection,

cat > foo
testing deleted files

instead of,

cat > foo

On some more experimentation I realised this is how `cat' behaves, it 
doesn't show the lines written the first time, it only shows the stdin 
which is perfectly reasonable. My apologies :-p

>
> poc
>

-- 
Suvayu

Open source is the future. It sets us free.


More information about the users mailing list