16 June 2011

C:> Using fdb On Windows

It has become clear that fdb hasn’t been tested much on Windows. [1]

However, Over the last few days, fdb has been used a bit more on Windows, and as a result I’ve made some changes to make the experience on Windows a littler better.

Here are a couple of things that might be worth knowing if you’re using it on Windows. [2]

  1. Credentials. In the past, fdb would look for a credentials file (containing username, password and optionally a tag-path preference) in the user’s home directory, but to do that reliably required a non-standard python library. That seems like an unnecessary dependency. So I’ve changed this. Now, on Windows, fdb consult the environment variable FDB_CREDENTIALS_FILE to find the location of said file; if it’s not set, the credentials file is assumed to be c:\fdb\credentials.txt (soon to become, c:\fish\credentials.txt).

  2. Quoting Queries. Fluidinfo expects string values in queries to be quoted using double quotes. On Unix, the usual way to handle that is to use single quotes around the query and put double quotes within. For example:

    $ fdb show -q 'fluiddb/about matches "café"' fluiddb/about

    On Windows, that doesn’t work. Instead, you need to use double quotes in both places. Because that means having double quotes within double quotes, the inner double quotes have to be escaped, and on Windows, the way this is achieved is with “stuttering”, i.e. repeating the quoted quote. So the Windows equivalent of the command above is:

    C:> fdb show -q "fluiddb/about matches ""café""" fluiddb/about

I guess I should also say that the above is based on Windows XP. I haven’t tried it on Vista or Windows 7. If you try it and run into different behaviour, or other problems, let me know.

[1]Windows hates me and has always made it abundantly clear that it considers me to be an idiot, so I try to avoid it much myself.
[2]When I say “Windows”, what I really mean in using the Windows shell. I’m not entirely what the right name for that is. I mean thing that you get if you select Run... from the Start menu and then type cmd. The thing the used to be called the (MS)-DOS shell. The Windows command line. C:>! If you’re using Cygwin, it’s more-or-less the same as on Unix-like systems.

No comments:

Post a Comment