The new streaming client, version 6.0 uses a new format for storing the profile data. The CAB format has been replaced by the DIR format for good reasons.

The DIR format is just a plain directory structure that stores all the profile data which was earlier compressed in the form of a CAB file. Amongst other advantages, the DIR format does not have the overhead associated with compressing and decompressing the CAB structure.

With this background, I’d come to the main part of this post.

As a part of their application publishing activity, administrators might need to move/copy the profiles from one AppHub (fancy name for file share) to another. While this was as simple as doing a simple copy-paste operation with the CAB format, it has a small caveat with the DIR format. Read on.

Since the DIR format is essentially the uncompressed representation of the pre-existing CAB format, it implies that all content that was earlier packed in a single CAB file is now kept “as it is”. This also arises the possibility of having files kept at the leaf nodes of highly nested folders. Unfortunately, if the nesting goes beyond MAX_PATH character length, Windows refuses to do operations like copying the file since it is not capable of handling such long paths.

Now the question might arise, if Windows cannot handle it, how did the file come to existence in the first place,leave alone the problem of copying it. The answer is that it is possible to handle long path names at API levels because Windows file system provides support for it. So when the files were created at the first instance, it was done through the profiler which was handling long path names. But when it comes to Windows Explorer, it is unable to do so.

As a result, when copying a profile folder from say location A to location B, Windows will complain for some profiles (the ones which have path names exceeding MAX_PATH), that the path is too long to copy and will fail.

Solution:

Windows might not be able to do it, but there are tools which can. While there can be a lot of tools to achieve this, i would suggest the use of Robocopy.

Robocopy comes built-in into Windows 7. It is also a free download from the Microsoft network for other operating systems. It stands for RobustCopy. Robocopy takes care of long path names by itself and it will copy files on those paths successfully. While the tool has a lot of command line flags, i’d like to highlight the following:

Usage: Robocopy source destination [file] options

Flags:

1. /MIR: MIRror a directory tree.

2. /MT : Use multi-threaded copy (Applicable only to Win7)

This shall be sufficient for copying DIR based profiles from one location to another and you will not run into the problem of long path names.

Happy Copying !

PS: If you are interested in knowing the reasons for making a move from the CAB to DIR structure, there is a very good post by the Streaming Architect, Joseph Nord. You can visit it at http://community.citrix.com/display/ocb/2009/12/04/App+Streaming+-+CAB+to+DIR

Aman Sethi.