From owner-freebsd-emulation Mon Sep 23 00:32:46 1996 Return-Path: owner-emulation Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id AAA24063 for emulation-outgoing; Mon, 23 Sep 1996 00:32:46 -0700 (PDT) Received: from genesis.atrad.adelaide.edu.au (genesis.atrad.adelaide.edu.au [129.127.96.120]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id AAA24010 for ; Mon, 23 Sep 1996 00:32:39 -0700 (PDT) Received: from msmith@localhost by genesis.atrad.adelaide.edu.au (8.6.12/8.6.9) id RAA24335 for emulation@freebsd.org; Mon, 23 Sep 1996 17:02:32 +0930 From: Michael Smith Message-Id: <199609230732.RAA24335@genesis.atrad.adelaide.edu.au> Subject: DOScmd redirector hair-tearing time To: emulation@freebsd.org Date: Mon, 23 Sep 1996 17:02:31 +0930 (CST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-emulation@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Argh! Thanks to a bug report from Robert Eckardt, I've been following the behaviour of the DOScmd redirector during 'file copy' operations. The following session comes from : doscmd -bxR d: cd tmp copy rc baz 0 file(s) copied And the debugging output from the copy operation looks like this (edited and annotated) : dos_getcwd(3) -> \TMP D:\TMP\RC -> drive D func 2e (us) REDIR: 2e (extended open/create) dos_makepath(3, \TMP\RC) dos_to_real_path(D:\TMP\RC) mopen(//tmp/rc) action 0x101 mode 0x0 attr 0x0 omode 0x40 success, fd 5 status 1 REDIR: returns 0 (OK) dos_getcwd(3) -> \TMP (no path) -> drive D func 6 (us) REDIR: 06 (close) close(5) REDIR: returns 0 (OK) Open the source, file, then close it again. Weird. dos_getcwd(3) -> \TMP D:\TMP\RC -> drive D func 1b (us) REDIR: 1b (find first) find_first(D:\TMP\RC, 0, 159e) dos_makepath(3, \TMP\RC) dos_to_real_path(D:\TMP) REDIR: returns 0 (OK) Then search for the file. dos_getcwd(3) -> \TMP D:\TMP\BAZ -> drive D func 2e (us) REDIR: 2e (extended open/create) dos_makepath(3, \TMP\BAZ) dos_to_real_path(D:\TMP\BAZ) mopen(//tmp/baz) action 0x101 mode 0x0 attr 0x0 omode 0x40 REDIR: returns 2 (FILE_NOT_FOUND) Try to open the destination, fail if not found. Which it's not. dos_getcwd(3) -> \TMP D:\TMP\BAZ -> drive D func 5 (us) REDIR: 05 (chdir) dos_makepath(3, \TMP\BAZ) dos_to_real_path(D:\TMP\BAZ) dos_readonly(3) -> 0 chdir(//tmp/baz) dos_setcwd(D:\TMP\BAZ) dos_makepath(3, \TMP\BAZ) dos_to_real_path(D:\TMP\BAZ) REDIR: returns 3 (PATH_NOT_FOUND) Try to chdir to the destination. Weird. dos_getcwd(3) -> \TMP D:\TMP -> drive D func 5 (us) REDIR: 05 (chdir) dos_makepath(3, \TMP) dos_to_real_path(D:\TMP) dos_readonly(3) -> 0 chdir(//tmp) dos_setcwd(D:\TMP) dos_makepath(3, \TMP) dos_to_real_path(D:\TMP) REDIR: returns 0 (OK) Chdir back. Also Weird. dos_getcwd(3) -> \TMP D:\TMP\BAZ -> drive D func f (us) REDIR: 0f (stat) dos_makepath(3, \TMP\BAZ) dos_to_real_path(D:\TMP\BAZ) REDIR: returns 2 (FILE_NOT_FOUND) Try to stat the destination. Which doesn't exist. dos_getcwd(3) -> \TMP D:\TMP\RC -> drive D func 2e (us) REDIR: 2e (extended open/create) dos_makepath(3, \TMP\RC) dos_to_real_path(D:\TMP\RC) mopen(//tmp/rc) action 0x101 mode 0x0 attr 0x0 omode 0x40 success, fd 5 status 1 REDIR: returns 0 (OK) dos_getcwd(3) -> \TMP (no path) -> drive D func 8 (us) REDIR: 08 (read) read(5, 65024) offset now 7634 REDIR: returns 0 (OK) dos_getcwd(3) -> \TMP (no path) -> drive D func 6 (us) REDIR: 06 (close) close(5) REDIR: returns 0 (OK) Open, read and close the source. All OK. dos_getcwd(3) -> \TMP D:\TMP\BAZ -> drive D func 2e (us) REDIR: 2e (extended open/create) dos_makepath(3, \TMP\BAZ) dos_to_real_path(D:\TMP\BAZ) mopen(//tmp/baz) action 0x112 mode 0x401 attr 0x0 omode 0x21 success, fd 5 status 2 REDIR: returns 0 (OK) dos_getcwd(3) -> \TMP (no path) -> drive D func 9 (us) REDIR: 09 (write) write(5, 7634) offset now 7634 REDIR: returns 0 (OK) dos_getcwd(3) -> \TMP (no path) -> drive D func 6 (us) REDIR: 06 (close) close(5) REDIR: returns 0 (OK) Open, write and close the destination. All OK. dos_getcwd(3) -> \TMP D:\TMP\BAZ -> drive D func 13 (us) REDIR: 13 (unlink) dos_makepath(3, \TMP\BAZ) dos_to_real_path(D:\TMP\BAZ) dos_readonly(3) -> 0 unlink(//tmp/baz) REDIR: returns 0 (OK) And then delete the destination?! What the hell? If I disable the 'unlink' call, then the file can be seen to have been correctly copied, but that doesn't explain what DOS is so unhappy about that it'd delete the destination. None of the redirector calls have returned anything other than OK (other than the 'qualify' calls which I pruned for brevity). Any ideas? -- ]] Mike Smith, Software Engineer msmith@atrad.adelaide.edu.au [[ ]] Genesis Software genesis@atrad.adelaide.edu.au [[ ]] High-speed data acquisition and (GSM mobile) 0411-222-496 [[ ]] realtime instrument control (ph/fax) +61-8-267-3039 [[ ]] Collector of old Unix hardware. "Where are your PEZ?" The Tick [[