FS: port commands to C++, rename fdir to glob