On 01/11/10 13:20, Steve Loughran wrote:
> On 01/11/10 10:43, [email protected] wrote:
>>
>>
>> Hi,
>>
>> I would like to delete multiple files, using a pattern. This seems like
>> a common enough action, but I can’t figure out how to do it with
>> standard components.
>>
>
> That's an interesting thought, I've just run over the source code to see
> what we do there.
>
> Summary: we have components that delete entire directories, both the
> Tempdir and Mkdir components can do this when being terminated, and
> that's all we've needed.
>
> That said, DeleteFile and DeleteDir components would be useful in some
> situations, so I've added two bugreps
>
> http://jira.smartfrog.org/jira/browse/SFOS-1541
> http://jira.smartfrog.org/jira/browse/SFOS-1542
>

A quick look at the code shows me that you can use SelfDeletingFile to 
delete a file on startup by configuring itself to shut itself down just 
after starting up.

DeleteFileOnStartup extends SelfDeletingFile {
     sfShouldTerminate true;
}

This is only for a single file and doesn't handle error reporting well, 
as all code to clean things up on shutdown tends to log-and-continue on 
any problem.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Smartfrog-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/smartfrog-users

Reply via email to