std.stdio.File is throwing with the message of: "Access Violation"

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Thu Aug 19 03:25:31 UTC 2021


On Wednesday, 18 August 2021 at 17:42:53 UTC, Ruby The Roobster 
wrote:
>   All I did was try to access a file with a self-made library.  
> It didn't work.  I tried again directly from the main file. 
> This is the code:
>
>   ```d
>   File file = 
> File("E:\\Users\\User\\Desktop\\dutils\\test.spr","r"); //This 
> file exists on my system, so it should work...
>   file.close();
>   ```
>
>   Output(Given to me by a message box that display's 
> Throwable.msg in it's body):
>      Access Violation
>
>   Is this a bug, or me being stupid? If it's the latter, than 
> tell me what went wrong.  I am using DMD 2.097.2

This is an error message you'll get from Windows if the file is 
locked (open by another application).


More information about the Digitalmars-d-learn mailing list