Mercurial > vim
comparison runtime/doc/builtin.txt @ 30150:0fe61fa4e5d1 v9.0.0411
patch 9.0.0411: only created files can be cleaned up with one call
Commit: https://github.com/vim/vim/commit/6f14da15ac900589f2f413d77898b9bff3b31ece
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Sep 7 21:30:44 2022 +0100
patch 9.0.0411: only created files can be cleaned up with one call
Problem: Only created files can be cleaned up with one call.
Solution: Add flags to mkdir() to delete with a deferred function.
Expand the writefile() name to a full path to handle changing
directory.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 07 Sep 2022 22:45:04 +0200 |
parents | ebed259f919f |
children | ba22d5536d3e |
comparison
equal
deleted
inserted
replaced
30149:58dd17222e56 | 30150:0fe61fa4e5d1 |
---|---|
6237 | 6237 |
6238 < *mkdir()* *E739* | 6238 < *mkdir()* *E739* |
6239 mkdir({name} [, {path} [, {prot}]]) | 6239 mkdir({name} [, {path} [, {prot}]]) |
6240 Create directory {name}. | 6240 Create directory {name}. |
6241 | 6241 |
6242 If {path} is "p" then intermediate directories are created as | 6242 If {path} contains "p" then intermediate directories are |
6243 necessary. Otherwise it must be "". | 6243 created as necessary. Otherwise it must be "". |
6244 | |
6245 If {path} contains "D" then {name} is deleted at the end of | |
6246 the current function, as with: > | |
6247 defer delete({name}, 'd') | |
6248 < | |
6249 If {path} contains "R" then {name} is deleted recursively at | |
6250 the end of the current function, as with: > | |
6251 defer delete({name}, 'rf') | |
6252 < Note that when {name} has more than one part and "p" is used | |
6253 some directories may already exist. Only the first one that | |
6254 is created and what it contains is scheduled to be deleted. | |
6255 E.g. when using: > | |
6256 call mkdir('subdir/tmp/autoload', 'pR') | |
6257 < and "subdir" already exists then "subdir/tmp" will be | |
6258 scheduled for deletion, like with: > | |
6259 defer delete('subdir/tmp', 'rf') | |
6260 < Note that if scheduling the defer fails the directory is not | |
6261 deleted. This should only happen when out of memory. | |
6244 | 6262 |
6245 If {prot} is given it is used to set the protection bits of | 6263 If {prot} is given it is used to set the protection bits of |
6246 the new directory. The default is 0o755 (rwxr-xr-x: r/w for | 6264 the new directory. The default is 0o755 (rwxr-xr-x: r/w for |
6247 the user, readable for others). Use 0o700 to make it | 6265 the user, readable for others). Use 0o700 to make it |
6248 unreadable for others. This is only used for the last part of | 6266 unreadable for others. This is only used for the last part of |