Question Sabit Issakhan · Aug 27, 2018

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? 

Comments

Eduard Lebedyuk · Aug 27, 2018

Please check the output:

set result = ##Class(%File).Delete(fileNamewithPath, .status)
zw result
zw status
0
Sabit Issakhan  Aug 27, 2018 to Eduard Lebedyuk

Thanks for answer!

result = 1, status = -2

0
Eduard Lebedyuk  Aug 27, 2018 to Sabit Issakhan

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.

0
Sabit Issakhan  Aug 28, 2018 to Eduard Lebedyuk

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.)

0
Eduard Lebedyuk  Aug 28, 2018 to Sabit Issakhan

Terminal works under your own OS user.

Studio pseudo-terminal works under Cache system account.

They may have different access levels.

0