In that case you'll want to use %Net.SSH.Session to connect to the site and once signed in use the OpenSFTP method to open a SFTP session to be able to make %Net.SSH.SFTP calls, in particular the Put or PutStream method
- Log in to post comments
In that case you'll want to use %Net.SSH.Session to connect to the site and once signed in use the OpenSFTP method to open a SFTP session to be able to make %Net.SSH.SFTP calls, in particular the Put or PutStream method
Is there some reason why you want to use FTP instead of SFTP?
If you want to get rid of spaces the simplest way is use $TRANSLATE
SET NoSpaces=$TRANSLATE(line," ")
The value we wanted should have been a simple string, and we did not
know how to convert the output to string
##class(%SYSTEM.Encryption).MD5Hash() does return a string, what do you mean by 'simple'? If you mean 'displayable' that will depend on what you're trying to display on.
Take a look at ##class(%SYSTEM.Encryption).Base64Encode() that will return a string with only non-control ASCII characters.
It also requires Unicode, it won't work on a 8-bit installation.
Use $ZDATEH() to convert to internal $HOROLOG format, and $ZDATE() to convert to your desired format
WRITE $ZDATE($ZDATEH("14JAN1991",8),8)
The question was about alternatives to using % which is what I answered.
You could also use process-private globals
I find it simpler to use $Extract, e.g. $E(x,1,7)="%sqlcq."
Are the %occLibrary entry points documented anywhere as being available for use by applications?
If its OK for the DB to be off line for a little bit a simple kludge would be to use the SYS.Database DismountDatabase class method to dismount it and then when the copy is done use MountDatabase to mount it.
type KILL DO ^%IS hit Enter twice WRITE
and look at what IOF and IOST are set to
SET $ZT = "CommandErr"
OPEN Command:"QR"
FOR {
USE command
READ Text
USE $P
SET Array($I(Array))=Text
}
CommandErr ;
SET $ZT=""
SET ZE=$ZE
USE $P
CLOSE command
IF $P(ZE,">")'="<ENDOFFILE" {
; some error other than end of file
}
ELSE {
; parse contents of Array()
}
If the command you're using doesn't support redirection to a file use a command pipe e.g. SET $ZT="CommandErr" OPEN Command:"QR" FOR { USE Command READ Text USE $P ; do something with the text } CommandErr ; SET ZE=$ZE SET $ZT="" USE $P CLOSE Command IF $P(ZE,">")="<ENDOFFILE" { ; successful completion } ELSE { ; something happened }
Figure out how you'd do it at a command prompt and then issue that command with $ZF(-1)
You could put an entry in /etc/sudoers to allow them to run ccontrol.
You could try using $QUERY to iterate the global and use $QLENGTH to determine how deep you are and $QSUBSCRIPT to determine what the subscripts are.