COMANDO $ZF
Hello everyone
I have a problem with $ ZF (-1)
I need to delete file from windows folder example c: \ sys \ text.txt, when executing the w $ zf (-1, "c: \ sys \ text.txt") command, the file does not delete.
There is some other cache command that performs this task.
hugs
Davidson
Function $zf(-1) just executes a command passed as the second argument, you passed only file name. it is not complete, you should add command del for Windows.
it should return 0 if the command was successful.
If you want just delete a file, you can use %File class, useful for many different operations with files and folders.
Dmitry, Thanks for the help, perfect.
With this class is it possible to copy and move files as well? If possible send me how to make the file copy enters folders and also move file from one folder to another.
Thank you
can be replaced with:
Also, what does this command do?
Full doc is here :
https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?APP=1&LIBRARY=%25SYS&CLASSNAME=%25Library.File
Method CopyFile:
https://docs.intersystems.com/latest/csp/documatic/%25CSP.Documatic.cls?PAGE=CLASS&LIBRARY=%25SYS&CLASSNAME=%25Library.File#METHOD_CopyFile
Rename method there to move the file.
The original author is storing the output of the command into a temporary global ^TMP.
$ZN is the routine name of his tool.
$J is the job number or Process ID of the job running.
The command: kill ^TMP($ZN,$J) is cleaning up things making sure he starts with a empty global.
Hi Davidson
Please note $zf(-1 is now depreciated as of the most recent releases/patches of Caché
The replacement is $zf(100 - but stressing this will only work on the most recent patches
Peter
Another option is to use the open command where first argument is the OS command. Then you can get the answer from OS. For example:
Regards
Manel
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue