busybox-w32 icon indicating copy to clipboard operation
busybox-w32 copied to clipboard

du warns on junctions -- dd not before

Open stepht opened this issue 2 years ago • 2 comments

I have read othe issues about junctions but du did not warn before

C:\pt\scoop\apps>bb | bb head BusyBox v1.36.0-FRP-4716-g31467ddfc (2022-06-09 19:36:25 BST) (mingw64-gcc 11.2.1-5.fc36; mingw64-crt 9.0.0-3.fc36; glob) BusyBox is copyrighted by many authors between 1998-2022. Licensed under GPLv2. See source distribution for detailed copyright notices. Usage: busybox [function [arguments]...] or: busybox --list[-full] or: busybox --install [-s] [-u|DIR]

C:\pt\scoop\apps>bbo | bbo head BusyBox v1.35.0-FRP-4487-gd239d2d52 (2021-10-18 12:48:22 BST) (mingw64-gcc 10.3.1-2.fc34; mingw64-crt 8.0.0-2.fc34; glob) BusyBox is copyrighted by many authors between 1998-2021. Licensed under GPLv2. See source distribution for detailed copyright notices. Usage: busybox [function [arguments]...] or: busybox --list[-full] or: busybox --install [-s] [-u|DIR]

C:\pt\scoop\apps>bb du -ms poppler du: poppler/current: Invalid argument 35 poppler

C:\pt\scoop\apps>bbo du -ms poppler 35 poppler C:\pt\scoop\apps>_p Página de códigos activa: 850 C:\pt\scoop\apps>

hth --steph

stepht avatar Jun 24 '22 22:06 stepht

It isn't a general problem with junctions, just those created by (certain versions of?) Windows PowerShell. It's a known issue: PowerShell creates incomplete junctions.

I've reverted to a different method to fetch the contents of junctions. The code is bigger, but it should work with incomplete junctions.

Please try the most recent prerelease binary.

rmyorston avatar Jun 25 '22 12:06 rmyorston

Hi, thanks for the fix! I have tested the new binary busybox_pre64 seems to work ok!

Here are my tests, both cmd console and cygwin mintty (git-bash mintty ok too)

In a cyg-mintty terminal I tested last busybox and preview busybox_pre64 has been shimmed as bbp (preview)

In case you wonder a shim is a small exe .exe that looks for .shim and starts whatever progam is pointed to by the path var in the .shim file

besides bb I also have a shim cy for cygwin-bash or cygwin-mksh

% steph@kerangi (/scush) %
% cygpath -ma .
C:/pt/scoop/shims

% steph@kerangi (/scush) %
% cat -evnt bbp.shim
     1  M-oM-;M-?path = C:\pt\scoop\apps2\busybox\busybox_pre64.exe^M$

% steph@kerangi (/scush) %
% ll bbp.exe
-rwxrwxr-x+ 1 steph steph 126464 Oct  9  2020 bbp.exe

% steph@kerangi (/c/pt/scoop/apps2/okular) %
% bb | bb head -n2  # _or_ bb | cy head -n2 ## these "tsack" nicely!
BusyBox v1.36.0-FRP-4716-g31467ddfc (2022-06-09 19:36:25 BST)
(mingw64-gcc 11.2.1-5.fc36; mingw64-crt 9.0.0-3.fc36; glob)

% steph@kerangi (/c/pt/scoop/apps2/okular) %
% bb du -ms current/
391     current/

% steph@kerangi (/c/pt/scoop/apps2/okular) %
% bb du current
4       current

 

these last two tests show that with a junction created by 'cmd /c mklink /J current some-path latest bb works as you said

more tests with cmd console now

C:\pt\scoop\apps>fd -d2 current ammonite | cy cat
ammonite\current

C:\pt\scoop\apps>fd -d2 current ammonite | bb cat & _p
ammonite\current
Página de códigos activa: 850

C:\pt\scoop\apps>bbp sh -c "e=ammonite\\current; echo $e; [ -f $e ] || echo NOOK -f; ls --color=never $e"
ammonite\current
NOOK -f
amm.bat
install.json
manifest.json

C:\pt\scoop\apps>bbp sh -c "e=ammonite\\current; echo $e; [ -d $e ] && echo OK -d; ls --color=never $e"
ammonite\current
OK -d
amm.bat
install.json
manifest.json

### with older bb

C:\pt\scoop\apps>bb sh -c "e=ammonite\\current; echo $e; [ -d $e ] && echo OK -d; ls --color=never $e"
ammonite\current
ls: ammonite\current: Invalid argument

stepht avatar Jul 03 '22 20:07 stepht

Should be fixed in the latest release.

rmyorston avatar Nov 10 '22 13:11 rmyorston