我有一个无限循环过程。我将检查一个文件,一旦文件存在,便对其进行处理。 如果我找到了文件,然后将其锁定,是否可以进行操作,这样人们将无法打开或修改文件,直到过程完成。
do{
if(Test-Path -Path ".\Data.txt")
{
$file = Get-content -Path ".\Data.txt"
## do some process ##
#
#
#
#
#modify the file extension to .don once
# process
#
#FINISHED (the process will finished once the extension modified)
}
}
while(1)
任何人都可以提出想法。谢谢。