Re: [Github-comments] [geany/geany] Geany does not flush the entire buffer on save (#2434)
Follow up to previous comment, as suspected, its not possible for plugins to get the `FILE*` between the write and the close, so no way a plugin can `fsync` the file. If the functionality is added it will have to be in Geany itself. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/2434#issuecomment-618890439
Re: [Github-comments] [geany/geany] Geany does not flush the entire buffer on save (#2434)
@SergeyIvanov87 whilst its a good idea to add it to a plugin to be easier and faster to be accepted, I can't check now, but I'm not sure that a plugin can actually intercept the saving process between writing and closing so you would not have the file descriptor available. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/2434#issuecomment-617460597
Re: [Github-comments] [geany/geany] Geany does not flush the entire buffer on save (#2434)
@elextr Do you mean - it need to add another check box `fsync` (with a pretty name) in `/plugins/saveactions.c`? If yes, than I can prepare such PR in the nearest time -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/2434#issuecomment-617414533
Re: [Github-comments] [geany/geany] Geany does not flush the entire buffer on save (#2434)
Well, with lots of files open and given all the weird networked filesystems some people use `fsync`ing every save may be very expensive. And things like the "Save Actions` plugin save repeatedly, so it would probably need to be an option and would only apply to the "unsafe save" method that Geany controls the code for. PRs are welcome. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/2434#issuecomment-616873792
Re: [Github-comments] [geany/geany] Geany does not flush the entire buffer on save (#2434)
@elextr Thanks for great IDE! it is very useful for me for several years about 'fflush', as described in man pages: ...write of all **user-space** buffered data After that (fflush or fclose) the data pushed into system-buffers from user-space, and not written on device actually. I faced with that issue with fflush too, when worked on high I/O consumption application. The completely solution is use 'man 3 open' with SYNC or use 'fsync'. But both operate with file descriptor instead of streams -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/2434#issuecomment-616566390
Re: [Github-comments] [geany/geany] Geany does not flush the entire buffer on save (#2434)
Although documentation for `fflush()` says `fclose()` does flush the streams so it should be doing it already. @geekguy-wy which file saving method are you using (see [the wiki](https://wiki.geany.org/config/all_you_never_wanted_to_know_about_file_saving)? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/2434#issuecomment-585427576
Re: [Github-comments] [geany/geany] Geany does not flush the entire buffer on save (#2434)
This would only apply to "unsafe save" since its the only code we control. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/geany/geany/issues/2434#issuecomment-585425458