Outlined below is an example of how to check if a directory exists:
Set directoryName="c:\temp\nosuchdir"
/* Check for existence of a directory - Return Value: 0 - directory does not exist; 1 - directory does exist */
Set directoryExists=##class(%File).DirectoryExists(directoryName)
If ('directoryExists) // do the processing for when a directory does not exist
Outlined below is an example of how to check if a file exists:
We're developing Ensemble PoC and one day our frontend developer (who doesn't have Ensemble production running) said that Populate just doesn't cut it and he needs to see the real data. He needed only one object, but the problem was - it's a big object. Still, I checked ids of everything related and wrote this command (parts omitted, but you get the idea):
Process-private Globals can be used as a data global in storage definition. That way, each process can have its own objects for the class with ppg storage. For example lets define a pool, which can:
Several years ago, long before Developer Community Portal was launched, I published a series of Caché tricks at one of Czech web sites. In this article, I’m posting translated version of one of them.
Capturing output of someone else’s methods or routines
Suppose you, or someone else created a useful method or routine, that was producing some computation that you’d like to benefit from, but the routine was writing output to process principal device.
You would like to use the data, but you need it not written to a device, but assigned to a variable. And, for any reason, you can’t modify the code. What can you do?
This article created as side effect of preparations to the longer set of articles about simple, but still handy MapReduce implementation in Caché. I was looking for relatively easy way to pass arguments to (potentially) multiple targets via remote calling facilities. And after several attempts I have realized that we do have very powerful mechanism in the Caché ObjectScript which might be of particular help here – dynamic dispatch for methods and properties.
There have been a few use cases recently within InterSystems where we've needed to connect to Caché-based web services from PHP. The first of these was actually the Developer Community itself, which uses web services as part of Single Sign-On with other InterSystems sites/applications. The following example demonstrates how to connect to a Caché-based web service (particularly, the web service in the SAMPLES namespace) from PHP, using password authentication.
RESTful API Call From Cache to Particle.io Electron
Tom Fitzgibbon | Multidata | 212-967-6700 x537 | tom@mul.com
Summary: Simple Blink Tutorial for Particle.io Electron Device from Cache
Electron device is a tiny ARM processor ($40-$60) that connects to Particle’s world wide leased 2G/3G network (about $3/mo) and runs off an included LiPo battery. Using Cache’s %Net.HttpRequest you can send/receive data, control hardware and read sensors.
Attached is an example of a web service client that can be used to do a lookup against the CMS NPPES database to validate and retrieve information about a given National Provider Identification (NPI).
The attached zip file contains a bunch of examples of Cache SQL Storage mappings that I have done over the years.
If you have existing globals and want to expose them via Objects or SQL you need to setup Cache SQL Storage mapping. If you do not see an example that helps with your case send me an example and I can help you out.
Tip dvacátý šestý: objekty a concurrency 2 - swizzling
Když tento seriál před několika lety začínal, byl jeho první díl věnován zajištění izolace instance objektů pro exkluzivní přístup a popisu příslušných API funkcí. Nedávno se mi ale stalo, že mě tento díl dostihl. Jeden ze zákazníků začal mít problémy v aplikaci, přestože důsledně používal exkluzivní zámky pro editování instancí svých objektů.