Home › Forums › DITA and XMetaL Discussion › Read only file system? › Reply To: Read only file system?
Reply to: Read only file system?
September 14, 2010 at 7:06 pmIt might work. The code (inside multipleOutput.mcr inside the Startup folder) that decides where to create the preview files is as follows:
[code]function getPreviewPath(docPath,fileExt)
{
var fPath = “”;
try{
removeTmpPreviewFiles();
var fso = new ActiveXObject(“Scripting.FileSystemObject”);
if (docPath != “” && docPath.substr(0, 5) != “http:”){
var docPathObject = fso.GetFolder(docPath);
if (docPathObject.attributes & 1)
{ // ActiveDocument.Path is Read-Only, use css folder instead
var dir = getXMDocumentFolder();
fPath = Application.UniqueFileName(dir,”PRV”,fileExt);
}
else
fPath = Application.UniqueFileName(docPath,”PRV”,fileExt);
}
else {
var dir = getXMDocumentFolder();
fPath = Application.UniqueFileName(dir,”PRV”,fileExt);
}
}
catch(e){
}
if (fPath != “”) gTmpPrviewFile.push(fPath);
return fPath;
}[/code]
If the Windows File System Object tells that code the path is read-only the logic is supposed to save the temp files to the same folder as the CSS file (typically included with the customization). You can check the path that XMetaL is going to try to save to by running this:
[code]//XMetaL Script Language JScript:
var dir = getPreviewPath(ActiveDocument.Path,”.xml”);
Application.Alert(dir);[/code]