📄 mf_unlink.hlp
字号:
{smcl}
{* 31mar2005}{...}
{cmd:help mata unlink()}
{hline}
{* index unlink()}{...}
{* index _unlink()}{...}
{* index file processing}{...}
{* index erase}{...}
{title:Title}
{p 4 4 2}
{bf:[M-5] unlink() -- Erase file}
{title:Syntax}
{p 8 12 2}
{it:void}{bind: }
{cmd:unlink(}{it:real scalar filename}{cmd:)}
{p 8 12 2}
{it:real scalar}
{cmd:_unlink(}{it:real scalar filename}{cmd:)}
{title:Description}
{p 4 4 2}
{cmd:unlink()} erases {it:filename} if it exists; does nothing if
{it:filename} does not exist, and aborts with error if {it:filename}
exists but cannot be erased.
{p 4 4 2}
{cmd:_unlink()} does the same, except that, if {it:filename} cannot be
erased, rather than aborting with error, {cmd:_unlink()} returns
a negative error code. {cmd:_unlink()} returns 0 if {it:filename}
was erased or {it:filename} did not exist.
{title:Remarks}
{p 4 4 2}
To remove directories, see {cmd:rmdir()} in
{bf:{help mf_chdir:[M-5] chdir()}}.
{title:Diagnostics}
{p 4 4 2}
{cmd:unlink(}{it:filename}{cmd:)}
aborts with error when {cmd:_unlink()} would give a negative result.
{p 4 4 2}
{cmd:_unlink(}{it:filename}{cmd:)} returns a negative result if the
file cannot be erased and returns 0 otherwise.
If the file did not exist, 0 is returned.
When there is an error,
most commonly returned are -3602 (filename invalid) or -3621 (file is
read-only).
{title:Source code}
{p 4 4 2}
Functions are built-in.
{title:Also see}
{p 4 13 2}
Manual: {hi:[M-5] unlink()}
{p 4 13 2}
Online: help for
{bf:{help m4_io:[M-4] io}}
{p_end}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -