Bugzilla – Attachment 19 Details for
Bug 30
Finalization failure in complex case
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Bug creation and email sending has been disabled, file new bugs at
gcc.gnu.org/bugzilla
Minimal failure example code.
failure.d (text/x-dsrc), 950 bytes, created by
David Brown
on 2012-12-28 09:19:53 CET
(
hide
)
Description:
Minimal failure example code.
Filename:
MIME Type:
Creator:
David Brown
Created:
2012-12-28 09:19:53 CET
Size:
950 bytes
patch
obsolete
>/* Demonstrate gdc failure. */ > >import std.file; >import std.random; >import std.stdio; > >scope class TmpDir { > this() { > auto count = 0; > > while (true) { > _path = "/tmp/test-" ~ makeName(); > try { > mkdir(_path); > break; > } catch (FileException e) { > count++; > } > > if (count > 5) > throw new Exception("Unable to create temp directory"); > } > } > > ~this() { > writefln("Cleaning up: '%s'", _path); > rmdirRecurse(_path); > } > > @property string path() { return _path; } > >private: > string _path; > > string makeName() { > auto buf = new char[12]; > > for (auto i = 0; i < buf.length; i++) { > buf[i] = uniform!("[]")('a', 'z', rand); > } > > return cast(string)buf; > } > > static Random rand; > > static this() { > rand.seed(unpredictableSeed); > } >} > >void main() { > void run() { > scope auto dir = new TmpDir(); > > mkdir(dir.path ~ "/hello"); > auto f = File(dir.path ~ "/hello/goodbye", "w"); > } > > run(); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 30
: 19 |
20