[Swift-devel] Standard Library Proposal/Discussion Page

Mihael Hategan hategan at mcs.anl.gov
Thu Jan 22 14:46:12 CST 2015


On Thu, 2015-01-22 at 14:14 -0600, Yadu Nand Babuji wrote:
> >> remove    (/rm)
> >> move ?    ( python doesn't seem to have this)
> > Like move and remove files? Do you have an example of how these would be
> > used?
> I remember a case where a directory is actively getting filled with data 
> that needs to be processed.
> So, we map the input_queue directory, "move" the file to the active 
> directory and start the processing.
> 
> file active_files[] <simple_mapper; location="active_list", prefix="active"> ;
> file completed[];
> 
> iterate ( ){
>      file new_files[] = <simple_mapper; location="input_queue", prefix="foo">;
>      foreach f in new_files{
>          move ( f, active_files[length(active_files)] );          # We move the file, so that it is not processed again in the next round.
>          completed[length(completed)] = process(active_file);
>          sleep(60);
>      }
> }until ( status == 10000 );

Does this work without move()? Say, by doing the move in a script as
part of process()?

Mihael




More information about the Swift-devel mailing list