Forum Discussion

Morgan's avatar
Morgan
Frequent Contributor
9 years ago
Solved

aqFileSystem to locate that a folder exists not working quite right

I'm using aqFileSystem to check that a folder exists but for some reason, the below script keeps hitting the 'else' statement even though when I debug 'sTestPath + where', the correct path is present AND that path does match what appears on the computer.

 

Additionally, is there a better way to remove a trailing backslash than aqString.Remove?  

 

Thank YOU,

Morgan

 

(where is a case statement but essentially a path)...

 

where := '\StdData\'+BaseName;

sTestPath := aqString.Remove(Project.Variables.TestPath, 8, 1); 

 

If aqFileSystem.Exists(sTestPath + where) then 
begin 
     Log.Message('ValidReports folder present')
end
else
begin
     BuiltIn.ShowMessage(Project.Variables.TestPath + where + ' folder is missing from the ValidReports folder!');
     Runner.Halt(Project.Variables.TestPath + where + ' folder is missing from the ValidReports folder!');
end;

2 Replies

  • Morgan's avatar
    Morgan
    Frequent Contributor

    OOPS.  I figured out the problem with aqFileSystem.exists... I THOUGHT I was directing to the correct path but I was actually missing a component.

     

    That part is good.  The question on removing a backslash remains.  :)

     

    Thanks!

    Morgan