file
file copied to clipboard
Permission Error Writing a file on Windows 10 & PHP 7.4
The same error happens, no matter what the permissions are.
The same exact code works fine under Linux.
Exception: fwrite(): write of 8192 bytes failed with errno=13 Permission denied in BlockingFile.php:66
Previous TL trace: exceptionErrorHandler() BlockingFile.php(66): fwrite() Files.php(1153): write()
Same here: https://del.dog/uthobinaca.txt
I also have this problem, no solution yet?
Failed writing to file handle: fwrite(): write of 8192 bytes failed with errno=13 Permission denied
Does it work without amphp/file?
Oh sure. I tried to reproduce this example, it worked great
Can fopen() open in the wrong mode?
Yes, maybe that's the case. How do you open the file?
I don't know, this is not my library. I just use it and find it breaks at this point. And I have no idea why ...
Can the developer of this library tell me? @amphp-bot
Not within the library, but rather how you use the library to open the file. Please post a full example to reproduce the issue.
Issue happens in \Amp\File\BlockingFile::write, which used in MadelineProto downloadTo* methods
I think trace should be like this:
- https://github.com/danog/MadelineProto/blob/06bc28e093a238591e9983e6110f1e3f871931be/src/danog/MadelineProto/MTProtoTools/Files.php#L801
- https://github.com/danog/MadelineProto/blob/d31b798df9347022a06026c18a012bc39762537d/src/danog/MadelineProto/MTProtoTools/FilesLogic.php#L101
- https://github.com/danog/MadelineProto/blob/d31b798df9347022a06026c18a012bc39762537d/src/danog/MadelineProto/MTProtoTools/FilesLogic.php#L129
Yes, maybe that's the case. How do you open the file?
https://github.com/danog/MadelineProto/blob/06bc28e093a238591e9983e6110f1e3f871931be/src/danog/MadelineProto/MTProtoTools/Files.php#L815
i love you