Branch: Tag:

2003-03-19

2003-03-19 10:53:26 by Jonas Wallden <jonasw@roxen.com>

Wait for subprocesses to exit before calling rm() on temp files to solve a
problem where the files are left open.

Rev: lib/modules/Search.pmod/Filter.pmod/Base.pike:1.15
Rev: lib/modules/Search.pmod/Filter.pmod/PDF.pmod:1.14
Rev: lib/modules/Search.pmod/Filter.pmod/Word.pmod:1.11

1:   // This file is part of Roxen Search   // Copyright © 2001 Roxen IS. All rights reserved.   // - // $Id: Word.pmod,v 1.10 2003/01/27 15:10:10 mattias Exp $ + // $Id: Word.pmod,v 1.11 2003/03/19 10:53:26 jonasw Exp $      inherit Search.Filter.HTML;   
31:    string doc = combine_path(getcwd(), fn);    mixed err = catch    { -  text = my_popen( ({ bin, "-1", "-c", "utf-8", "-x", xml, doc }), cwd); +  // Wait for process exit since rm() may otherwise fail +  text = my_popen( ({ bin, "-1", "-c", "utf-8", "-x", xml, doc }), cwd, 1);    };    if(!rm(fn))    werror("Search: Failed to remove temporary file: %s\n", fn);