delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/08/02/21:49:48

From: "Andrew Cottrell" <AndrewCottrell AT swiftdsl DOT com DOT au>
To: <djgpp-workers AT delorie DOT com>
Subject: RE: mv bug (filutils? library?)
Date: Sun, 3 Aug 2003 11:49:17 +1000
Message-ID: <000001c35961$76c1d4a0$0101a8c0@acp42g>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.4510
Importance: Normal
In-Reply-To: <3F2BF070.9DC47E21@phekda.freeserve.co.uk>
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

FYI. WIP debugging update below.

I have traced the problem so far to the rename() in move.c which is in
LIBC!!!! The problem line is:-

      if (rename (src_path, dst_path)== 0)
	  if (x->verbose && S_ISDIR (src_type))
	    printf ("%s -> %s\n", quote_n (0, src_path), quote_n (1,
dst_path));

Here is my debugging printf() output is:-

DJ204 D:\dj204\gnu\filutil4.1\src\Test
Test11>\dj204\gnu\filutil4.1\src\mv.exe -
v junk1 junk1
movefile (char *source = junk1, char *dest= junk1, int dest_is_dir = 1,
const s
truct cp_options *x)
mv.c 345
 base_name(source = junk1)
 path_concat (dest = junk1, src_basename = junk1, NULL)
new_dest result junk1/junk1, x
do_move (source = junk1, new_dest = junk1/junk1, x
mv.c 171 : source = junk1 dest = junk1/junk1
copy.c 1296 copy_into_self = TRUE
copy.c 599 copy_into_self = TRUE
copy.c 604 copy_into_self = FALSE
copy.c 632
copy.c 635
copy.c 644
copy.c 796
copy.c 849
copy.c 853 rename(src_path = junk1, dst_path = junk1/junk1
copy.c 856 rename(src_path = junk1, dst_path = junk1/junk1) == False
copy.c 870
copy.c 891
mv: cannot move `junk1' to a subdirectory of itself, `junk1/junk1'
copy.c 899 copy_into_self = TRUE
mv.c 181
mv.c 185
mv.c 189
mv.c 238
mv.c 270
mv.c 272
result = True

Here are the directory listing before line 849 was displayed (I also have
some getkey() to allow checking directories):-
DJ204 D:\dj204\gnu\filutil4.1\src>dir "Test Test11\junk1"

DJ204 D:\dj204\gnu\filutil4.1\src>dir "Test Test10\junk1"
 Volume in drive D has no label.
 Volume Serial Number is 3E10-A62B

 Directory of D:\dj204\gnu\filutil4.1\src\Test Test10\junk1

03/08/2003  11:38 AM    <DIR>          .
03/08/2003  11:38 AM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)   4,335,501,312 bytes free

Here is the directory after line 870:

DJ204 D:\dj204\gnu\filutil4.1\src>dir "Test Test11\junk1\junk1"
 Volume in drive D has no label.
 Volume Serial Number is 3E10-A62B

 Directory of D:\dj204\gnu\filutil4.1\src\Test Test11\junk1\junk1

03/08/2003  11:41 AM    <DIR>          .
03/08/2003  11:41 AM    <DIR>          ..
03/08/2003  11:41 AM    <DIR>          junk1


Regards,
Andrew


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019