L1.01 PSH5X treats / and \ as equivalent path separators. Don't even think about using them in link names!
Apart from the . (dot) character, only the / (slash) character enjoys a special status in HDF5 path names as the path separator. As a result, link names must not contain slashes. PSH5X treats forward slashes (/) and backslashes (\) as equivalent path separators. Hence, in PSH5X, a link name must not contain either. (There's no such restriction for HDF5 attribute names.)
In PSH5X, the following drive-qualified path names are equivalent:
- 'h5:/What/ a /nice/ path'
- 'h5:\What\ a \nice\ path'
- 'h5:/What\ a /nice\ path'
KI1.01 The -Recurse parameter in the Remove-Item cmdlet does not work properly.
This is a known bug in PowerShell 2.0
Let's take a look at the implementated behavior of Remove-Item. It expects a drive-qualified path and accepts two switches, -Recurse and -Force. The -Recurse switch has an effect (recursive deletion) only for HDF5 groups. The -Force switch tells Remove-Item to delete ALL links leading to the HDF5 object specified in the path name and has no effect if the path refers to a symbolic link.
To be specific, let's look at an example. Below, the (multi-)graph structure of an HDF5 file is shown. The file contains four datasets, two groups, a committed datatype, and a soft link.
The HDF5 path name space consists of the following paths.
/dset1 /dset2 /dset3 /group1 /group1/dset3 /group2 /group2/dset3 /slink1 /type1
Assume that we've created an HDF5 drive backed by this file and that the root group is our "working directory". We can describe the effect of different invocations of the Remove-Item cmdlet by showing the change with respect to the original HDF5 path name space.
- Remove-Item slink1
/dset1 /dset2 /dset3 /group1 /group1/dset3 /group2 /group2/dset3 /type1
# we are just deleting the hard link 'group2' /dset1 /dset2 /dset3 /group1 /group1/dset3 /slink1 /type1
Remove-Item group2 -Recurse
/dset1 /dset2 /dset3 /group1 /slink1 /type1
Remove-Item group2 -Force
# since group1 links to the same object it gets deleted as well with -Force /dset1 /dset2 /dset3 /slink1 /type1
The PowerShell bug shows for case numbers 2 and 4. You'll be prompted as follows:
PS:24 >remove-item .\group2 Confirm The item at h5:\group2 has children and the Recurse parameter was not specified. If you continue, all children will be removed with the item. Are you sure you want to continue? [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
This sounds pretty scary, but, in the case of an HDF5 group, doesn't make a lot of sense. All we are doing is delete one (2.) or all (4.) links that lead to an HDF5 group. In other words, all path names containing these link names will become unavailable. Without recursion, we don't touch the (link) members of that group and alternative paths bypassing the referenced group remain available.
- - Last modified:May 17th 2012