I'm confused ! If you turn directory creation to manual. Suppose you create a XML file with URL /foo/bar/spam.xml
My 'understanding' (from reading the ML docs) is that there is no directory "/foo/bar/" Since no directories were created, none exist. Is this just terminology ? or is there something else under the hood I'm missing. To me this implies that URI's need not have "directories" associated with them. Is this wrong ? -----Original Message----- From: Michael Blakeley [mailto:michael.blake...@marklogic.com] Sent: Tuesday, August 31, 2010 12:20 PM To: General Mark Logic Developer Discussion Cc: Lee, David Subject: Re: [MarkLogic Dev General] Query on directories David, that approach works as long as your directory has a corresponding directory fragment (either with directory-creation=automatic or with manually-created directories). But it's also possible - and fairly common - to use xdmp:directory() without having any directory fragments (directory-creation=manual). Most large database applications set directory-creation=manual for efficiency reasons. So any general-purpose code should be written to work for both cases. You might think of these as explicit vs implicit directories. A webdav client will only see explicit directories: it needs the directory fragment for locking purposes. But any database query can make use of implicit directories. For most purposes I would use lock-free code to check for a directory uri: xdmp:exists(xdmp:directory($uri, 'infinity')) -- Mike On 2010-08-31 07:38, Lee, David wrote: > I'm not sure what a "tenant database" is, but if you want to query if a > directory exists, you can use this code > (copied from the MarkLogic extension to xmlsh, command "direxists" > www.xmlsh.org) > > > > declare variable $uri external ; > exists(xdmp:document-properties($uri)//prop:directory) > > > > > From: general-boun...@developer.marklogic.com > [mailto:general-boun...@developer.marklogic.com] On Behalf Of Vishnu Raaj > Sent: Tuesday, August 31, 2010 3:11 AM > To: general@developer.marklogic.com > Subject: [MarkLogic Dev General] Query on directories > > Hi All, > > I’m new to MarkLogic. > > Is there any way to check whether a tenant database exists in a MarkLogic > database? > > As per my understanding, MarkLogic treats tenant db as directory. Currently > there are only functions for CreateDirectory and DeleteDirecotory. I would > like to know is there any facility to check whether a directory exists. > > Please help. > > Regards, > VishnuRaaj R|Senior Engineer : Microsoft-Global Practices|MindTree Ltd.|TP > 2/2, Ascendas Mahindra IT Park, Mahindra World City - SEZ, Natham Sub Post, > Chengalpet, Chennai - 603002, INDIA|Voice +91 44 67497150 / Mobile +91 > 9994109328|email: > vishnu_r...@mindtree.com<mailto:vishnu_r...@mindtree.com>|www.mindtree.com<http://www.mindtree.com/>| > > [cid:image001.jpg@01CB48F8.9CC18A90] Save a tree > > > ________________________________ > http://www.mindtree.com/email/disclaimer.html > _______________________________________________ General mailing list General@developer.marklogic.com http://developer.marklogic.com/mailman/listinfo/general