【发布时间】:2014-07-15 11:55:21
【问题描述】:
在https://stackoverflow.com/a/3220688/180275 中,答案表明(在open 之后)$^E 可以与 0x20 进行比较以确定文件是否正在被另一个进程使用:
open ($fh, "<", "the-file");
if ($^E == 0x20) {
...
}
我已经尝试过了,它有效。 但是,如果我打印 $^E 的值,我会得到一个字符串 (The process cannot access the file because it is being used by another process)。
那么如何与一个数字进行比较呢?
这是在 Windows 上。
【问题讨论】:
标签: perl error-handling