IBM Lotus Symphony


MkDir ステートメント [実行時]

データメディア上に新しいディレクトリを作成します。

構文:

MkDir Text As String

パラメータ:

Text: 作成するディレクトリの名前とパスを指定する任意の文字列式。URL 表記を使用することもできます。

パスが判別されない場合は、現在のディレクトリにディレクトリが作成されます。

エラーコード

5 無効なプロシージャ呼び出しです

76 パスが見つかりません

例:

Sub ExampleFileIO

' ファイル編成関数の例

Const sFile1 as String = "file://c|/autoexec.bat"

Const sDir1 as String = "file://c|/Temp"

Const sSubDir1 as String ="Test"

Const sFile2 as String = "Copied.tmp"

Const sFile3 as String = "Renamed.tmp"

Dim sFile as String

sFile = sDir1 + "/" + sSubDir1

ChDir( sDir1 )

If Dir(sSubDir1,16)="" then ' ディレクトリの存在チェック

MkDir sSubDir1

MsgBox sFile,0,"Create directory"

End If

sFile = sFile + "/" + sFile2

FileCopy sFile1 , sFile

MsgBox fSysURL(CurDir()),0,"Current directory"

MsgBox sFile & Chr(13) & FileDateTime( sFile ),0,"Creation time"

MsgBox sFile & Chr(13)& FileLen( sFile ),0,"File length"

MsgBox sFile & Chr(13)& GetAttr( sFile ),0,"File attributes"

Name sFile as sDir1 + "/" + sSubDir1 + "/" + sFile3

' Rename in the same directory

sFile = sDir1 + "/" + sSubDir1 + "/" + sFile3

SetAttr( sFile, 0 ) 'すべての属性を削除

MsgBox sFile & Chr(13) & GetAttr( sFile ),0,"New file attributes"

Kill sFile

RmDir sDir1 + "/" + sSubDir1

end sub

' URL のシステムパスを変換

Function fSysURL( fSysFp as String ) as String

Dim iPos As String

iPos = 1

iPos = Instr(iPos,fSysFp, getPathSeparator())

do while iPos > 0

mid( fSysFp, iPos , 1,"/")

iPos = Instr(iPos+1,fSysFp, getPathSeparator())

loop

' DOS にコロンを指定

iPos = Instr(1,fSysFp,":")

if iPos > 0 then mid( fSysFp, iPos , 1,"|")

fSysURL = "file://" & fSysFp

End Function


製品フィードバック | その他の資料 | 商標