GNU bug report logs - #48081
diff on windows doest work with same path but different drives

Previous Next

Package: diffutils;

Reported by: dreverser <at> gmail.com

Date: Wed, 28 Apr 2021 14:23:02 UTC

Severity: normal

To reply to this bug, email your comments to 48081 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-diffutils <at> gnu.org:
bug#48081; Package diffutils. (Wed, 28 Apr 2021 14:23:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to dreverser <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-diffutils <at> gnu.org. (Wed, 28 Apr 2021 14:23:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: dreverser <at> gmail.com
To: bug-diffutils <at> gnu.org
Subject: diff on windows doest work with same path but different drives
Date: Wed, 28 Apr 2021 14:46:30 +0300
diff on windows doest work with same path but different drives

diff -urN D:\path1\ D:\path2  - works
diff -urN E:\path1\ D:\path1  - doest works, empty output

early version of diff was report "recursive directory loop"
but currently version of diff wholly empty output




Information forwarded to bug-diffutils <at> gnu.org:
bug#48081; Package diffutils. (Thu, 29 Apr 2021 15:17:01 GMT) Full text and rfc822 format available.

Message #8 received at 48081 <at> debbugs.gnu.org (full text, mbox):

From: dreverser <at> gmail.com
To: 48081 <at> debbugs.gnu.org
Subject: bug#48081: Acknowledgement (diff on windows doest work with same path
 but different drives)
Date: Thu, 29 Apr 2021 18:16:02 +0300
after little research iam found the issue

iam using many cloned virtual disk drives
which has same serial number (becase was cloned)

diff uses "stat" call to get info about disk
so when i use sync between this disks
i have another mont drive letter  but same serial number, same path
diff -urN D:\path E:\path  give me there no diff, path the same

so i propose little fix for this
just edit at the file diffutils-3.7\lib\stat-w32.c

to "buf->st_dev" after assign "VolumeSerialNumber"
add disk drive letter
this will produce unique "st_dev"
and diff will work for such cases




Information forwarded to bug-diffutils <at> gnu.org:
bug#48081; Package diffutils. (Thu, 29 Apr 2021 17:01:01 GMT) Full text and rfc822 format available.

Message #11 received at 48081 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: dreverser <at> gmail.com
Cc: 48081 <at> debbugs.gnu.org, Bruno Haible <bruno <at> clisp.org>
Subject: Re: [bug-diffutils] bug#48081: Acknowledgement (diff on windows doest
 work with same path but different drives)
Date: Thu, 29 Apr 2021 10:00:12 -0700
On 4/29/21 8:16 AM, dreverser <at> gmail.com wrote:
> so i propose little fix for this
> just edit at the file diffutils-3.7\lib\stat-w32.c
> 
> to "buf->st_dev" after assign "VolumeSerialNumber"
> add disk drive letter

Thanks for the suggestion. Although I don't use MS-Windows I will cc 
this email to someone who knows how stat-w32.c works. Bruno, you can see 
the thread here:

https://bugs.gnu.org/48081




Information forwarded to bug-diffutils <at> gnu.org:
bug#48081; Package diffutils. (Thu, 29 Apr 2021 19:58:01 GMT) Full text and rfc822 format available.

Message #14 received at 48081 <at> debbugs.gnu.org (full text, mbox):

From: dreverser <at> gmail.com
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 48081 <at> debbugs.gnu.org, Bruno Haible <bruno <at> clisp.org>
Subject: Re: [bug-diffutils] bug#48081: Acknowledgement (diff on windows doest
 work with same path but different drives)
Date: Thu, 29 Apr 2021 22:57:15 +0300
the issue little more complex for me
because iam using diff from git-windows package
where git/diff compiled with mingw cygwin depend dll
and doest use stat from diff

today iam post to cygwin maillist
and seems guys dont want to fix this, they decide the problem more
complex and has many corners

so will be nice to improve diff for windows without touch "stat" call

may be will possible change some logic into diff for windows

2021-04-29 20:00 GMT+03:00, Paul Eggert <eggert <at> cs.ucla.edu>:
> On 4/29/21 8:16 AM, dreverser <at> gmail.com wrote:
>> so i propose little fix for this
>> just edit at the file diffutils-3.7\lib\stat-w32.c
>>
>> to "buf->st_dev" after assign "VolumeSerialNumber"
>> add disk drive letter
>
> Thanks for the suggestion. Although I don't use MS-Windows I will cc
> this email to someone who knows how stat-w32.c works. Bruno, you can see
> the thread here:
>
> https://bugs.gnu.org/48081
>




Information forwarded to bug-diffutils <at> gnu.org:
bug#48081; Package diffutils. (Thu, 29 Apr 2021 22:13:01 GMT) Full text and rfc822 format available.

Message #17 received at 48081 <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 48081 <at> debbugs.gnu.org, dreverser <at> gmail.com
Subject: Re: [bug-diffutils] bug#48081: Acknowledgement (diff on windows doest
 work with same path but different drives)
Date: Fri, 30 Apr 2021 00:12:37 +0200
On 4/29/21 8:16 AM, dreverser <at> gmail.com wrote in https://bugs.gnu.org/48081 :
>> iam using many cloned virtual disk drives
>> which has same serial number (becase was cloned)

> > so i propose little fix for this
> > just edit at the file diffutils-3.7\lib\stat-w32.c
> > 
> > to "buf->st_dev" after assign "VolumeSerialNumber"
> > add disk drive letter

Nope. By using several disk drives with the same serial number, you
are outside the range of supportable situations.

The Windows API [1] describes dwVolumeSerialNumber as
  "The serial number of the volume that contains a file."
The term "serial number" implies that different volumes have different
serial numbers.

Fixing diffutils for native Windows would not help generally.

This Windows API is surely used by hundreds of programs. Many of
them will malfunction in your situation. For example, a disk management
program might, when you give it the instruction to format the second
disk, instead format the first disk.

Disk serial numbers are also used to make sure that the mount points
of two mounts in the file system don't change if you move the disks
to different USB ports (i.e. disk A on USB port 1 should mount in the
same place as when you plug it into USB port 2).

The only right fix is that you assign different serial numbers to your
disks. Only this will bring you back to a supported situation.

VirtualBox, for example, has a command to do this:
  VBoxManage internalcommands sethduuid copied-disk.vmdk

Bruno

[1] https://docs.microsoft.com/en-us/windows/win32/api/fileapi/ns-fileapi-by_handle_file_information





This bug report was last modified 3 years and 11 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.