> Bram Moolenaar wrote:
>
> > " Directory name completion
> > ! call mkdir('Xnamedir/XdirA/XdirB', 'p')
> > call writefile([], 'Xnamedir/XfileA')
> > call writefile([], 'Xnamedir/XdirA/XfileB')
> > call writefile([], 'Xnamedir/XdirA/XdirB/XfileC')
> > --- 2149,2155 ----
> > call VerifyScreenDump(buf, 'Test_wildmenu_pum_13', {})
> >
> > " Directory name completion
> > ! call mkdir('Xnamedir/XdirA/XdirB', 'pR')
> > call writefile([], 'Xnamedir/XfileA')
> > call writefile([], 'Xnamedir/XdirA/XfileB')
> > call writefile([], 'Xnamedir/XdirA/XdirB/XfileC')
>
> We only needed the 'R' flag for the root dir XnameDir/ but
> anyway it does seem to hurt to have it for subdirectories too.
It would not hurt, but it can be confusing. The first mkdir() will
create three directories, the top one being "XnameDir". That one will
then add a deferred call to "delete('XnameDir', 'rf')".
The second mkdir() will find that "XnameDir" already exists and only
creates a directory below it. The deferred delete() call when then only
delete what was created, thus "XnameDir" itself won't be affected.
This may seem a bit complicated, but it is required for something like:
mkdir('include/temp', 'pR')
To delete the while "include" directory, while it only created the
"temp" directory inside it. It's a lot safer to only delete what was
created.
--
hundred-and-one symptoms of being an internet addict:
71. You wonder how people walk
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220914162832.891891C1539%40moolenaar.net.