Find

Article
· Oct 12, 2021 2m read

%Net.FtpSession クラスを使用してファイルサイズを取得する方法

これはInterSystems FAQ サイトの記事です。

ファイルサイズを取得する専用メソッドはありませんが、%Net.FtpSession クラスの sendCommand() メソッドを通してFTPのSIZEコマンドを呼び出し、サイズを取得できます。

簡単な利用例をご紹介します。

まず、以下の様なクラスを定義します。

Class MyNet.FtpSession Extends %Net.FtpSession
{ Method getSize(fname As %String, ByRef size As %Integer)
{
set type=..Type  // 現Typeを保存しておく
do ..Binary()
set st=..sendCommand("SIZE "_fname) //SIZE <file name>
set size=..ReturnMessage
if type="Ascii" {
do ..Ascii()
}
quit
} }

上記で作成したクラスを使用したサンプルコードです。 

 set ftp=##class(MyNet.FtpSession).%New()
 write ftp.Connect(ftpsrv,user,pass)  // FTPサイトへ接続ができると1が返ります。
 do ftp.getSize(fname,.fsize)         // 第2パラメータに指定したファイルのサイズが返ります
 write "ファイルサイズ : ",fsize,!
 write ftp.Logout()                   // 成功したら1が返ります

 

※ sendCommand() メソッドは [Internal] 属性が付与されているため将来変更される可能性があります。

Discussion (0)1
Log in or sign up to continue
Article
· Oct 5, 2021 2m read

Webゲートウェイ/CSPゲートウェイの設定管理ページにどのクライアントからもアクセスできるようにする

これは InterSystems FAQ サイトの記事です。

Web/CSPゲートウェイ管理ページは、通常クライアントマシンからアクセスできないように構成されています。

 

クライアントからその管理ページにアクセスすると、以下の様なメッセージが返ってきます。

 

システム管理  このシステムを使用する権限がありません。

Not authorized to use this facility.

You are not authorized to use this facility.

 

任意のクライアントからアクセスするためには以下の操作を行います。

 

Web/CSPゲートウェイ管理ページにアクセス可能なシステムからブラウザを起動し、管理ポータルにアクセスします。


管理ポータル>システム管理>構成>の所でCSPゲートウェイ管理をクリックします。


表示されるページの左ペインに表示されるデフォルトパラメータをクリックします。

 

システム管理マシンの所に*.*.*.*と入力し、設定を保存ボタンを押下げます。

 

しかしながら任意のクライアントから管理ページにアクセスできるようにするのはセキュリティの観点からはあまりお勧めできません。


アクセスできるクライアントはなるべく限定することをお勧めします。

 

クライアントアドレスの指定方法としては、以下のような指定形式があります。

 

[SYSTEM]
System_Manager=190.8.7.4-6

上記の例は、以下の記述をより簡単にしたものです。

[SYSTEM]
System_Manager=190.8.7.6, 190.8.7.5, 190.8.7.4

以下の例のように、ワイルドカードも使用できます。

[SYSTEM]
System_Manager=190.8.7.*

またはCSP.iniを直接編集することで上記と同じ設定を行うことが可能です。

Windowsシステムの場合、<システムドライブ>:¥intepub¥CSPGatewayにCSP.iniファイルがあります。

UNIX系システムの場合、CSPnsdと同じディレクトリに、CSP.iniファイルがあります。

[SYSTEM]セクションに、以下の行を追加します。 

[SYSTEM]
System_Manager=190.8.7.6, 190.8.7.5, 190.8.7.4

 

ファイル修正後、この設定を反映するためには、CSPnsdの再起動が必要です。

 

詳細は、下記ドキュメントページをご参照ください。


Webゲートウェイ管理ページでのセキュリティの考慮事項【IRIS】
CSP ウェブゲートウェイ管理ページでのセキュリティの考慮事項

Discussion (0)1
Log in or sign up to continue
Question
· Sep 27, 2021

How to find a global's original namespace ? Potentially mapped from a different namespace

How to find a global's original namespace ? Potentially mapped from a different namespace .

I have a global ^Custom that exists in multiple namespaces but it could mapped from namespace Drone(A) to Launch(B)

Without access to Cache management portal how to find where is my global located using cache code ?

Like if ^Custom == ^[Drone]Custom ??

5 Comments
Discussion (5)0
Log in or sign up to continue
Question
· Sep 23, 2021

Problem starting production after upgrade cache to iris

Hello,

We upgrade from CACHE 2016 to IRIS 2021 and when we try to start a production gives the error behind.

I think the error could be that the Ens.Director is deprecated on IRIS 2021, is this possible? 

09/22/21-14:35:35:563 (16501) 1 [Utility.Event] Production AutoStart: ERROR in namespace 'REGINUS': 'ERROR <Ens>ErrException: <CLASS DOES NOT EXIST>zgetProductionItems+29^Ens.Director.1 *%Library.CacheStorage -- logged as '22 Sep 2021' number 1 @''' $ZU(56,2)='$Id: //adhocs-iris/2020.1.0.217.1/ISC_INTERNAL_BASE_20418_001/kernel/common/src/aclass.c#1 $ 9520 0'

5 Comments
Discussion (5)0
Log in or sign up to continue
Announcement
· Sep 20, 2021

Video: Kafka! Integrating the World's Favorite Stream Processor with InterSystems IRIS

Hey Developers,

Get an introduction to Apache Kafka, a popular event-streaming platform, and see a demonstration of the upcoming Kafka integration with InterSystems IRIS Interoperability:

⏯ Kafka! Integrating the World's Favorite Stream Processor with InterSystems IRIS


🗣 Presenter: Helen Bang, Systems Developer, InterSystems

Subscribe to InterSystems Developers YouTube. Enjoy and stay tuned!

1 Comment
Discussion (1)0
Log in or sign up to continue