How to register FUSE filesystem type with mount(8) and fstab?

In general, one “registers” a new mount filesystem type by creating an executable mount.fstype. $ ln -s /usr/bin/vdbfs.py /usr/sbin/mount.vdbfs If vdbfs.py takes mount-ish arguments (i.e. dev path [-o opts]), then mount -t vdbfs and using vdbfs as the 3rd field in fstab will work. If it doesn’t, you can create a wrapper which does take … Read more

How to get N files in a directory order by last modified date?

Limit just some files => pipe to Select-Object -first 10 Order in descending mode => pipe to Sort-Object LastWriteTime -Descending Do not list directory => pipe to Where-Object { -not $_.PsIsContainer } So to combine them together, here an example which reads all files from D:\Temp, sort them by LastWriteTime descending and select only the … Read more

How do I read in the contents of a directory in Perl?

opendir(D, “/path/to/directory”) || die “Can’t open directory: $!\n”; while (my $f = readdir(D)) { print “\$f = $f\n”; } closedir(D); EDIT: Oh, sorry, missed the “into an array” part: my $d = shift; opendir(D, “$d”) || die “Can’t open directory $d: $!\n”; my @list = readdir(D); closedir(D); foreach my $f (@list) { print “\$f = … Read more

Best way to determine if two path reference to same file in C#

As far as I can see (1) (2) (3) (4), the way JDK7 does it, is by calling GetFileInformationByHandle on the files and comparing dwVolumeSerialNumber, nFileIndexHigh and nFileIndexLow. Per MSDN: You can compare the VolumeSerialNumber and FileIndex members returned in the BY_HANDLE_FILE_INFORMATION structure to determine if two paths map to the same target; for example, … Read more