Windows File Path vs Linux File Path or / to C:\

I am currently working with someone who is in the process of moving an application written in Cache Object Script over to a Windows server. It was previously running on a Linux server so all of the paths are unix style paths. Is anyone aware of a way to have cache remap paths to different paths so this user won't have to go through all of the scripts and change them?

In older versions of Cache 2007 for example you could setup a device where the name was "/somefolder/" and the physical path was "C:\somefolder\" and that worked. However in newer versions of Cache you get <NOTOPEN> if you try to write to a device like that. I assume this was undefined behavior to begin with but it was very handy.

Answers

Some general advice:

  1. Root directory should be a configurable setting,
    • Before changing config, call NormalizeDirectory method of %File class
    • Check that directory exists and you can write to it
    • If it's Ensemble check that Ensemble can write to that directory too
  2. Try to minimize the number of root directories, if you have to have several. It's preferable to use subdirectories.
  3. Calculate all subdirectories via calls to SubDirectoryName method from %File class
  4. You should not have slash symbols for directories/files purposes in your code base.

I understand, however I didn't write any of this code. The hard coded values were accumulated over several years.