ReFS

Illustration

For long time now NTFS is the system of choice for Windows. Well, that is about to change.

For upcoming Windows 8 beta we shall get Resilient File System (ReFS for friends). Features are making my head spin:

  • Compatible with NTFS application layer.
  • Data is verified and auto-corrected.
  • Live data recovery (bye, bye offline mode).
  • Transactional model.

From design point of view it looks more like unholy combination of relational database and version control than a file system (that sounds familiar). As I read I decided that it will be my new system to install Windows 8 on. And then I noticed two deal breakers: It will be available only on Windows Server 8 and you will not be able to boot of it.

At first this file system is intended for Windows Server 8 volumes only. You will boot good old NTFS and then store all your data on ReFS. And forget per-file encryption since EFS is not supported. Well, at least there is BitLocker.

My developer life is more aligned with Windows client OS than server so I will skip it for now. I just hope that ReFS will not stay limited to server but that it will find it’s way into consumer’s life also. And, Microsoft, don’t forget booting…

[2015-03-12: With Windows 8.1 you get ReFS on client Windows too.] [2017-09-05: ReFS is no longer supported on Windows 10 Pro.]

Again

Illustration

More observant among you might notice that there is already new version of VHD Attach. Those who use it on Windows 7 and Windows Server 2008 R2 have no reason to worry: only difference between versions 3.00 and 3.01 is that VHD Attach now supports Windows Thin PC.

If you happen to use Windows Thin PC than just remember to install .NET Framework 4.0 before VHD Attach and you should be just fine.

VHD Attach 3.00

Few last tweaks are completed and it is time for new version of VHD Attach.

Biggest change to this version is addition of dynamic virtual disks creation. In addition to this, application now recognizes stolen extensions and offers fix. Upgrades should also be a little bit easier since there is in-application check for new versions.

There is lot of small cosmetic adjustments. Like switching focus to Explorer upon attaching Bit Locker drive or drag&drop support in main window. And lets not forget that those who love analyzing virtual disks just got few more details about VHD.

Check it yourself.

Renaming a File

Renaming a file is quite simple job in C#. You can just call File.Move(oldPath, newPath) and it works. That is until it doesn’t. Problem with this function is that it cannot rename file that differs only in case. E.g. test cannot be renamed to Test. And believe it or not, people sometime want to change case of their file.

Solution that first comes to mind is renaming file to something temporary and then back. E.g. test will be renamed to test-temp and then back to Test. While this solution works it makes exception handling annoying. Just what are you supposed to do if there is exception after you already created test-temp?

Fortunatelly Windows API is not so restrictive. Things can be as simple as calling MoveFile function. Or in our case MoveFileEx with parameters that ensure that we can move between volumes (MOVEFILE_COPY_ALLOWED) and that function returns only after work is done (MOVEFILE_WRITE_THROUGH). Quite straightforward code indeed:

public static void MovePath(string currentPath, string newPath) {
    if (currentPath.StartsWith(@"\\?\", StringComparison.Ordinal) == false) { currentPath = @"\\?\" + currentPath; }
    if (newPath.StartsWith(@"\\?\", StringComparison.Ordinal) == false) { newPath = @"\\?\" + newPath; }
    if (NativeMethods.MoveFileExW(currentPath, newPath, NativeMethods.MOVEFILE_COPY_ALLOWED | NativeMethods.MOVEFILE_WRITE_THROUGH) ==  false) {
        var ex = new Win32Exception();
        throw new IOException(ex.Message, ex);
    }
}

internal static class NativeMethods {
    public const uint MOVEFILE_COPY_ALLOWED = 0x02;
    public const uint MOVEFILE_WRITE_THROUGH = 0x08;


    [DllImportAttribute("kernel32.dll", EntryPoint = "MoveFileExW", SetLastError=true)]
    [return: MarshalAsAttribute(UnmanagedType.Bool)]
    public static extern bool MoveFileExW([InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string lpExistingFileName, [InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string lpNewFileName, uint dwFlags);
}

QText 3.00 (Beta)

Those with big number of files in QText have reason to rejoice. This version brings support for multiple folders. Unfortunate “victim” here are hidden files that are no longer with us. Do not worry - they are still accessible - installation procedure will move them into separate folder.

Corporate users might find it useful to run QText without installation. Running without installation was possible in previous versions but it also meant that QText left it’s traces around system. Now QText will only write in sub-folder from which it was started and nowhere else.

While QText has no synchronization mechanism by itself, special care was done in this version to make it behave more friendly toward third-party software (e.g. SugarSync and DropBox). This should prevent crashes caused by someone else holding file open.

Saving is now done 2.5 seconds after your typing has stopped. If file cannot be written to because some other program is holding it (see DropBox) three retries will be done. In addition to that immediate save will be triggered by folder change and closing of program. Of course you can save manually at any time.

I hope that not many users will cry for menu which is gone. All functions are accessible both from toolbar and context menu so there was not much sense in keeping it. Keyboard heavy users can always useorto access toolbar and+to access tab-specific menu. As beforewill bring you context menu for text.

There are some changes to existing shortcuts (++and+) and few new ones. Do consult ReadMe.txt for full list. If you are wondering where key is, that is that key next tothat has picture of menu. And Microsoft called it. Go figure…

Lot of effort has gone into this version to make it as stable as possible so I would encourage all to update regardless of beta status.

Check it at beta page.