bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: On darwin, diff <(echo ab) <(echo cd) does nothing


From: Vincent Lefevre
Subject: Re: On darwin, diff <(echo ab) <(echo cd) does nothing
Date: Sun, 21 Aug 2005 14:19:54 +0200
User-agent: Mutt/1.5.10-vl-20050813i

On 2005-08-21 13:28:47 +0200, Vincent Lefevre wrote:
> I'll try to print more information later...

This is even better with stat:

prunille:~> stat <(echo ab) <(head -n 1 file)
/dev/fd/15:
device  520093697
inode   0
mode    4528
nlink   1
uid     501
gid     501
rdev    0
size    0
atime   1124625898
mtime   1124625898
ctime   1124625898
blksize 512
blocks  0
link    

/dev/fd/16:
device  520093697
inode   0
mode    4528
nlink   1
uid     501
gid     501
rdev    0
size    0
atime   1124625898
mtime   1124625898
ctime   1124625898
blksize 512
blocks  0
link    

There are exactly the same values.

prunille:~> stat <(echo ab) <(head -n 1 file)
/dev/fd/15:
device  520093697
inode   0
mode    4528
nlink   1
uid     501
gid     501
rdev    0
size    3
atime   1124625902
mtime   1124625902
ctime   1124625902
blksize 512
blocks  8
link    

/dev/fd/16:
device  520093697
inode   0
mode    4528
nlink   1
uid     501
gid     501
rdev    0
size    0
atime   1124625902
mtime   1124625902
ctime   1124625902
blksize 512
blocks  0
link    

Here, the blocks value is difference (I assume this is the case when
diff prints out the diff).

Note: If I disable the same_files test with this:

  else if ((same_files
            = 0 && (cmp.file[0].desc != NONEXISTENT
[...]

then I get the correct diff output:

prunille:...ffutils-2.8.1/src> ./diff <(echo ab) <(echo cd)
1c1
< ab
---
> cd
zsh: exit 1     ./diff <(echo ab) <(echo cd)

If there could be a Mac OS X workaround, like disabling the same_files
test when the files are in /dev/fd, then this would be fine.

-- 
Vincent Lefèvre <address@hidden> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA




reply via email to

[Prev in Thread] Current Thread [Next in Thread]