[SOLVED] Files in Standard Deployment Archives

Author: cdouglass@siriussoftware.com.au (Colin)

 Hi,   Is there a proc code function that will tell me if a particular file (or component or anything else) exists in a UAR file? There is already $fileexists and $lfileexists that tell me if a file exists on the filesystem but I need something to tell me if it's in an archive.   Thanks, Colin Douglass


  1. Hi Colin, The functions $fileexists and $lfileexists will also tell you if a file exists in a ZIP archive (see the return value 4 - File exists in a ZIP archive). And you can use the logical path $RES (resources deployment path) with $(l)fileexists to check if a component (or another runtime object) exists. You just have to use the directory structure and naming conventions for resources (for details see Standardized Directory Structure). For example, if you would like to check if the form component CUSTOMER1 exists then you could do this:

    vReturn = $lfileexists("$res:frm\customer1.frm")

    If vReturn is 4 then you know that the mentioned component exists in a UAR file - and it's 1 in case the component is located in a resource directory. And if you want to know in which UAR file (or resource directory) the component is located then you could use $fileproperties (or $lfileproperties). Hope this helps. Kind regards, Daniel Iseli Uniface Support [UPDATE: May 3, 2016] Corrected sample

    Author: diseli (daniel.iseli@uniface.com)
  2. Hi Daniel, Thanks for the reply. I couldn't get your solution of preceding the filename by the directory ("frm\customer1.frm") to work until I also added the $res path. So I had to use vResult = $fileexists("$res:frm\customer1.frm") Using that I got the desired result of 4. Is that what you expected? Am I using $fileexists correctly? I am using Uniface   Thanks, Col.

    Author: Colin (cdouglass@siriussoftware.com.au)
  3. Hi Colin, Thanks for your reply. And yes, you are using $fileexists correctly. I'm not sure what happened here, but it seems that the post-editor has swallowed parts of my reply - or maybe I'm just getting old. Confused I've corrected my previous post accordingly. Kind regards, Daniel

    Author: diseli (daniel.iseli@uniface.com)