On Thursday, 13 July 2017 at 10:56:20 UTC, unDEFER wrote:
Seems I have found. I must do:
try{
File file;
try {
file = File(path);
}
catch (Exception exp)
{
return;
}
//Some actions with file
}
catch (ErrnoException)
{
return;
}
Well, yes, you can
Thank you. I will write if will find the reason of description
corruption.
On Thursday, 13 July 2017 at 11:15:56 UTC, Moritz Maxeiner wrote:
---
ubyte[File.sizeof] _file;
ref File file() { return *(cast(File*) &_file[0]); }
[create File instance and assign to file]
scope (exit) destroy(file);
---
Forgot to add the try catch:
---
ubyte[File.sizeof] _file;
ref File fil
On Thursday, 13 July 2017 at 10:28:30 UTC, unDEFER wrote:
On Thursday, 13 July 2017 at 08:53:24 UTC, Moritz Maxeiner
wrote:
Where does that `File` come from? If it's std.stdio.File, that
one is a struct with internal reference counting, so it
shouldn't crash in the above. Could you provide a mi
Seems I have found. I must do:
try{
File file;
try {
file = File(path);
}
catch (Exception exp)
{
return;
}
//Some actions with file
}
catch (ErrnoException)
{
return;
}
On Thursday, 13 July 2017 at 08:53:24 UTC, Moritz Maxeiner wrote:
Where does that `File` come from? If it's std.stdio.File, that
one is a struct with internal reference counting, so it
shouldn't crash in the above. Could you provide a minimal
working (in this case crashing) example?
Yes File
On Thursday, 13 July 2017 at 08:38:52 UTC, unDEFER wrote:
Hello! I have the code like this:
File file;
try {
file = File(path);
}
catch (Exception exp)
{
return;
}
...
try {
}
Where does that `File` come from? If it's std.stdio.File, that
one
What the God? I was not ready to post...
File file;
try {
file = File(path);
}
catch (Exception exp)
{
return;
}
try {
//Some actions with file
}
catch (ErrnoException)
{
return;
}
catch (ErrnoException) is necessary b
Hello! I have the code like this:
File file;
try {
file = File(path);
}
catch (Exception exp)
{
return;
}
...
try {
}