Christmas Treats
It's been a while since I last made a release, so here's a gift for Christmas!
New scripts
- distrib: Identify the Unix distribution and version. Works in any Posix shell, and in any Unix derivative.
- htmldec.tcl: Decode text strings that contain HTML entities. For use as a filter script with 1clip.exe/2clip.exe/12.bat.
- htmlenc.tcl: Encode text strings with the 3 basic HTML entities for & < >. For use as a filter script with 1clip.exe/2clip.exe/12.bat.
New features in existing scripts and programs:
- which.exe, dirc.exe, truename.exe now detect UWP applications execution links, and display their target.
- dirc.exe now reports WSL 2 symbolic links, and their targets. For WSL 1, it just reports it's an .
- which.exe now identifies pwsh.exe as PowerShell, and uses PowerShell rules when invoked inside pwsh.exe.
- TimeX.bat can now measure durations > 1 day, even over midnight, any day in the year.
- 2clip.exe, conv.exe now auto-detect UTF-8 and UTF-16 input, even without a BOM.
- 1clip.exe, 2clip.exe have new -8 and -16 options to force output to be UTF-8 or UTF-16.
- update.exe accepts target argument "D:=" as meaning "Same path as the source, but on drive D:"
- ipcfg.bat improved the network adapter name detection, and defined "VPN" as the alias for Pulse Secure VPN.
- conv.exe, detab.exe, lessive.exe, remplace.exe now accept -= as an alias for -same, meaning update a file in place.
Under the hood, in the MsvcLibX library
- The Windows build and release generation can now be done from the project root directory, like for Unix.
- All the Windows executables built go into the bin subdirectory in the project root directory.
- Functions readlink(), readdir(), lstat() now handle UWP App. Exec. links and WSL Linux symlinks as if they were standard symlinks.
- Added GNU C library routine asprintf(). Now used for debug output, where it avoid lots of fixed size buffers allocations.
Notes about UWP App. Exec. links
Universal Windows Platform (UWP) applications are new in Windows 10.
They are applications that can run on any types of Windows devices. (PCs, Phones, Xbox, IoT devices, etc)
Circa 2017, Windows 10 introduced a new kind of NTFS link, tagged as an IO_REPARSE_TAG_APPEXECLINK, or AppExecLink here for short.
Most UWP applications installations create an AppExecLink to the actual executable in "%LOCALAPPDATA%\Microsoft\WindowsApps".
This directory is in the Windows 10 PATH, and the links there avoid having to add each application's path to your global PATH.
These AppExecLinks differ from normal NTFS symbolic links in that they contain more than just a pointer to the executable.
I think the additional information helps Windows' CreateTask() speed up the UWP apps startup.
Anyway, 3 years later, Windows' cmd.exe and PowerShell 5.1 still report AppExecLinks as 0-bytes files.
Only the new PowerShell 7.0 correctly reports them as links.
Until now, the System Tools Library was not doing any better than cmd.exe.
But at last the new version released here handles them correctly.
For example if you have installed the Windows Terminal, which.exe now finds it correctly, and truename.exe and dirc.exe also:
C:\JFL\Temp>which wt
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.4.3243.0_x64__8wekyb3d8bbwe\wt.exe
C:\JFL\Temp>which -v wt
# C:\Users\Larvoire\AppData\Local\Microsoft\WindowsApps\wt.exe # UWP App. Exec. Link
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.4.3243.0_x64__8wekyb3d8bbwe\wt.exe
C:\JFL\Temp>which -l -v wt
# 2020-11-20 13:26:46 0 C:\Users\Larvoire\AppData\Local\Microsoft\WindowsApps\wt.exe -> C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.4.3243.0_x64__8wekyb3d8bbwe\wt.exe # UWP App. Exec. Link
2020-11-20 13:26:44 92672 C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.4.3243.0_x64__8wekyb3d8bbwe\wt.exe
C:\JFL\Temp>truename C:\Users\Larvoire\AppData\Local\Microsoft\WindowsApps\wt.exe
C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.4.3243.0_x64__8wekyb3d8bbwe\wt.exe
C:\JFL\Temp>dirc C:\Users\Larvoire\AppData\Local\Microsoft\WindowsApps\wt.exe
C:\Users\Larvoire\AppData\Local\Microsoft\WindowsApps
wt.exe -> C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.4.3243.0_x64__8wekyb3d8bbwe\wt.exe <APPEXECL> 2020-11-20 13:26:46
1 files or directories listed.
C:\JFL\Temp>