Article - CS374874
File object handle UNC path not working with JavaScript. PTC Arbortext Layout Developer
Modified: 20-Dec-2022
Applies To
- PTC Arbortext Layout Developer 12.0 to 12.1.3.1
- PTC Arbortext Advanced Print Publisher 12.0
Description
- File object handle UNC path does not work
- The following saves sample.txt to C:/temp as expected:
var FilePath = "C:/temp/sample.txt";
var file = new File(FilePath);
application.logs[5].write(file.path);
file.open("write,create", "text");
file.writeln("SAMPLE TEXT");
file.close();
var file = new File(FilePath);
application.logs[5].write(file.path);
file.open("write,create", "text");
file.writeln("SAMPLE TEXT");
file.close();
- The following is using the UNC path and does not output the file:
var FilePath = "//localhost/C$/temp.sample.txt";
var file = new File(FilePath);
application.logs[5].write(file.path);
file.open("write,create", "text");
file.writeln("SAMPLE TEXT");
file.close();
var file = new File(FilePath);
application.logs[5].write(file.path);
file.open("write,create", "text");
file.writeln("SAMPLE TEXT");
file.close();
This is a printer-friendly version of Article 374874 and may be out of date. For the latest version click CS374874