Forum Discussion
tristaanogre
9 years agoEsteemed Contributor
You could use the aqFileSystem object. There is a simple "Exists" method on that object that will check to see if a path to a file is valid. So, just quick and dirty JavaScript:
function testFileExists(filePath, fileName) { return aqFileSystem.Exists(filePath + fileName); } function Test1(){ var result; result = testFileExists('C:\\temp\\', 'myfile.txt'); result ? Log.Message('It is here') : Log.Warning('Nope'); }
- bbi9 years agoContributor
In addition you can check if folder exists with this function:
function folderExists(Folder) { var result = false; try { result = aqFileSystem.GetFolderInfo(Folder).Exists; } catch(e) { } return result; };
The Folder parameter may or may not include the trailing backslah, no matter.
Related Content
- 3 years ago
- 9 years ago
- 13 years ago
- 8 years ago
Recent Discussions
- 2 days ago