views:

33

answers:

1

I am using Qt and Ruby in an application where I have to manipulate some directories and rename/move files. However, prior to the actual manipulation I need to show a "preview", ie, simulation of the changes. What I've done on OS X and Linux is a collection of mkdir and touch commands, in a writable tmp space, to build my said "directory tree", fed that to Qt's QFileSystemModel widget and QTreeView, and I'd get my expected results.

However, I can not do that on Windows, because I have found no native counterpart to touch and thus I could not show the files. One suggestion that came to mind is to create my directory tree in memory, but then I can not feed it to QFileSystemModel anymore.

How can I do this?

A: 

Windows comes with a tool called fsutil, which can be used to create dummy files similar to Unix touch command:

fsutil file createnew PathName length

I am not sure if fsutil exist per default on the Home editions of Windows, but at least it is in the professional versions of XP through Windows 7.

See the full documentation for fsutil.

teukkam
Reading the documentation, it indeed looks like a solution to my issue, however, there's a limitation that renders it futile: "You must be logged on as an administrator or a member of the Administrators group in order to use fsutil." Within the context of my application, that does not work for me. Thank you
Ahmad Amireh