On Sunday, 25 September 2016 at 16:07:12 UTC, Matthias Klumpp
wrote:
Hello!
I have a class similar to this one:
```
class Dummy
{
private:
string tmpDir;
public:
this (string fname)
{
tmpDir = buildPath ("/tmp", fname.baseName);
std.file.mkdirRecurse (tmpDir);
On Sunday, 25 September 2016 at 16:07:12 UTC, Matthias Klumpp
wrote:
Hello!
I have a class similar to this one:
```
class Dummy
{
private:
string tmpDir;
public:
this (string fname)
{
tmpDir = buildPath ("/tmp", fname.baseName);
std.file.mkdirRecurse (tmpDir);
On Monday, 26 September 2016 at 09:43:02 UTC, Nemanja Boric wrote:
On Sunday, 25 September 2016 at 16:07:12 UTC, Matthias Klumpp
wrote:
At time, I work around this bug by calling close() manually at
the appropriate time, but this feel like a rather poor
solution.
Cheers,
Matthias
That's
On Sunday, 25 September 2016 at 16:07:12 UTC, Matthias Klumpp
wrote:
At time, I work around this bug by calling close() manually at
the appropriate time, but this feel like a rather poor solution.
Cheers,
Matthias
That's not a poor solution, but rather a much better solution if
you rely
use rc scheme (a-la std.stdio.File is using), so dtor will be
called deterministically, not by GC. here is the sample of that,
which creates lockfile. you can use RC implementation like that
for many other things. it is mostly as cheap as class: the main
struct is only size_t aka pointer (like
Hello!
I have a class similar to this one:
```
class Dummy
{
private:
string tmpDir;
public:
this (string fname)
{
tmpDir = buildPath ("/tmp", fname.baseName);
std.file.mkdirRecurse (tmpDir);
}
~this ()
{
close ();
}
void close ()