Permission bug in Edit[This]File()

11 views
Skip to first unread message

Carlo Hogeveen

unread,
Sep 14, 2025, 2:17:40 PM (11 days ago) Sep 14
to Semware @ GoogleGroups

Speaking of ...

If I use EditFile() or EditThisFile() to open a file that I do not have permission for, like
C:\swapfile.sys
\\wsl$\Debian\etc\sudoers
\\wsl$\Ubuntu\etc\sudoers
then these statements properly give an "Access denied: ..." warning, but then open an empty buffer "++noname++N" anyway, and return
its bufferid.

In practice I run into this when using WSL, and then it is minor annoyance.

Carlo



S.E. Mitchell

unread,
Sep 15, 2025, 6:24:44 PM (10 days ago) Sep 15
to sem...@googlegroups.com
Yeah, this one bugs me too.
The reason for it:
EditFile() creates buffers for all the filenames passed to it.
Then EditFile() positions to the first buffer it created, and calls loadfile().
And if loadfile() fails, then it needs to delete the just created
buffer, and (I guess) go to the previous buffer.
And so that seemed kind of hard, and I wasn't sure of the correct
action, so I punted, and it does what it does now.
I will revisit this, and see what I can do.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/semware/000201dc25a3%24d7bcbdc0%2487363940%24%40ecarlo.nl.
Reply all
Reply to author
Forward
0 new messages