or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - ".fragment";
scope(success) {
std.file.rename(tempFilename, filename);
}
auto f = File(tempFilename, "w");
}
and:
void transactionalCreate(string filename) {
strin
On 01/21/2011 02:18 PM, tamir wrote:
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - ".fragment";
scope(success) {
std.file.rename(tempFilename, filename);
}
auto f = File(tempFilename, "w");
}
and:
void tr
On Fri, 21 Jan 2011 08:18:15 -0500, tamir wrote:
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - ".fragment";
scope(success) {
std.file.rename(tempFilename, filename);
}
auto f = File(tempFilename, "w");
}
and
On Friday, January 21, 2011 05:18:15 tamir wrote:
> or what's the differents between theese two:
> void transactionalCreate(string filename) {
> string tempFilename = filename - ".fragment";
> scope(success) {
> std.file.rename(tempFilename, filename);
> }
> auto f = File(tempFilename,
When there are multiple calls that can fail, and where I have to do
clean-up code in a certain order and under certain conditions I use
scope(exit). For example:
import std.stdio;
import std.exception;
void main()
{
foo();
}
enum NoError = true;
bool Initialize() { return true; }
bool Start
On Friday, January 21, 2011 14:49:44 Andrej Mitrovic wrote:
> When there are multiple calls that can fail, and where I have to do
> clean-up code in a certain order and under certain conditions I use
> scope(exit). For example:
>
> import std.stdio;
> import std.exception;
>
> void main()
> {
>
On 01/21/2011 09:56 PM, Jonathan M Davis wrote:
On Friday, January 21, 2011 05:18:15 tamir wrote:
or what's the differents between theese two:
void transactionalCreate(string filename) {
string tempFilename = filename - ".fragment";
scope(success) {
std.file.rename(tempFilename, filen