PeopleCode删除文件的三种方法

PeopleCode删除文件的三种方法

1. 用GetFile先打开文件,然后用delete()删除文件

&MyFile = GetFile(&server_dir | &filename, "U", %FilePath_Absolute);

&MyFile.Delete();

2. 用Exec函数执行命令rm

&ExitCode = Exec("rm " | &scriptFile, %Exec_Synchronous + %FilePath_Absolute);

3. 用DeleteAttachment函数删除ftp服务器上的文件,但这种方法安全性不好,因为要指定ftp服务器的用户名密码!

&retcode = DeleteAttachment("fpt server:Oprid@Host" | &server_dir, &filename);

猜你喜欢

转载自blog.csdn.net/rizhinan/article/details/5348307