Back in the late 80s and early 90s of last century, engineers Richard E. Berry, Cliff J. Reeves set a standard that still influences the user interfaces and user experience of today: the IBM Common User Access.
I mentioned CUA a few times before, but since an old client of mine managed to throw away their paper originals in a “we don’t need that old stuff any more as we are now all digital” frenzy, I wanted to locate some PDFs. And I promised to write more about CUA.
The reason is that when using Delphi, the TOpenDialog and TSaveDialog will use the classic Open and Save Dialogs on Windows < Vista and fall-forward to the new Common Item Dialogs handled by TFileOpenDialog and TFileSaveDialog (both will not fall backward).
When you have your COM initialisation done wrong, your application appears to hang. Amidst the plethora of threads started by the COM subsystem, these two dead-lock:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
@echo off
:: http://superuser.com/questions/768984/show-exe-path-of-running-processes-on-the-command-line-in-windows
if [%1] == [] goto :help
PowerShell Get-Process %* ^| Format-List Path
goto :eof
:help
echo Syntax:
echo %0 ProcessName
echo Shows the full EXE paths of any running process with the ProcessName name.
echo Example:
echo %0 DevEnv
echo Shows the paths of running Visual Studio processes
The interwebs is full of posts telling about how to create file and directory junctions**.
But there is little information about removing them and even less being correct: some suggest to del a directory junction (which just deletes everything in it but the junction).
Finally there is little information about listing all junctions, so lets start with that:
Deleting a link depends on the kind of link, not the kind of source.
Since symlink and hardlinks are for files, and directory symlink and junctions are for directories, this is how:
Delete a directory symlink or junction using RMDIR.
SysInternals – I wrote about them before – has a great junction tool. It can be used to create, delete and (optionally recursively) list reparse points. All usages allow for file and directory junctions.
More about reparse points
This is about the **: actually they are reparse points; for files they are symlinks, for directories mostly junctions, but sometimes symlinks.
And actually the reason I wrote this blog post. As you also have hardlinks. Some combinations of files and directories with these kinds of links fail.
Lets first go to see what kind of links there are on a fresh Windows system.
This is the only directory symlink: C:\Users\All Users and junction will show it like this:
.\\?\C:\\Users\All Users: SYMBOLIC LINK
Print Name : C:\ProgramData
Substitute Name: \??\C:\ProgramData
It is unlike this directory junction C:\Users\Default User which junction will show as this:
\\?\C:\\Users\Default User: JUNCTION
Print Name : C:\Users\Default
Substitute Name: C:\Users\Default
Together with C:\Users\Default and C:\Users\desktop.ini they are hidden, so you need the /AH flag to show them using DIR (as a gist, since WordPress still screws up less than and greater than):
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Since symlinks are client side created and not verified until use, you can actually use mklink to create both file and directory symbolic links for a file. DIR shows them as SYMLINK or SYMLINKD.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
When you try this for directories, you are in for a few small surprises.
A SYMLINK to a directory neither works as file nor as directory. A SYMLINKD or JUNCTION to a directory works. Hardlinks don’t work for directories with reason: limit the risk of cycles.
Example batch file:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters