Delete Archieve

Hello! 

How to delete archieve file, i'm used ##Class(%File).Delete(fileNamewithPath), but this method doesn't help, 

Anybody know, how to delete file exactly? 

  • 0
  • 0
  • 149
  • 4
  • 1

Answers

Please check the output:

set result = ##Class(%File).Delete(fileNamewithPath, .status)
zw result
zw status

From windows error codes

2 (0x2)
The system cannot find the file specified.
ERROR_PATH_NOT_FOUND

Check your path, also Caché may not have access to the directory or file.

Hello Eduard!

When i deleted another file with Cache Terminal, status shows -5(Access Denied), 

But when i deleted that file with Studio Output, file deleted and status shows 0(The operation completed successfully.)

Terminal works under your own OS user.

Studio pseudo-terminal works under Cache system account.

They may have different access levels.