[pmwiki-users] pagelists link= with pages generated externally

Patrick R. Michaud pmichaud at pobox.com
Thu May 24 12:10:52 CDT 2007


On Thu, May 24, 2007 at 10:30:25AM -0500, Patrick R. Michaud wrote:
> On Thu, May 24, 2007 at 08:13:20AM -0500, Patrick R. Michaud wrote:
> > On Thu, May 24, 2007 at 10:13:24AM +0200, Christophe David wrote:
> > > If I want to have the files imported as soon as possible, is there a
> > > drawback in setting $ImportFreq=1 knowing that pages are only imported
> > > once ?
>  
> And, following up to my previous post, I should go ahead and
> outline the other ways to get things imported quickly
> without setting $ImportFreq to a low value.  [...]

And, following up to my followup, on the way to lunch I
thought of an even better/safer way to automatically trigger
the import.

 - When an external program creates a file for importing, say
   "XYZ.Report", have it initially write the file as "XYZ.Report,new"
   in the import/ directory.  The ",new" will prevent the ImportText 
   script from processing the file before the external program has 
   finished writing it.

 - After the external program has finished writing "XYZ.Report,new",
   have it remove any existing "XYZ.Report" file and rename
   "XYZ.Report,new" as "XYZ.Report".  This will cause the import/
   directory to have a new last modified date, triggering the
   ImportText script on the completed import file.

Other extensions bedies ",new" can work -- we just want to make
sure that ImportText doesn't see the file as some sort of pagename
before it's ready to be imported.

Pm



More information about the pmwiki-users mailing list