MkDir Statement

๋ฐ์ดํ„ฐ ๋งค์ฒด์—์„œ ์ƒˆ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค.

๊ตฌ๋ฌธ:

MkDir Text As String

๋งค๊ฐœ ๋ณ€์ˆ˜:

Text: ๋งŒ๋“ค๋ ค๋Š” ๋””๋ ‰ํ† ๋ฆฌ์˜ ์ด๋ฆ„๊ณผ ๊ฒฝ๋กœ๋ฅผ ์ง€์ •ํ•˜๋Š” ์ž„์˜์˜ ๋ฌธ์ž์—ด ์‹์ž…๋‹ˆ๋‹ค. URL ํ‘œ๊ธฐ๋ฒ•์„ ์‚ฌ์šฉํ•  ์ˆ˜๋„ ์žˆ์Šต๋‹ˆ๋‹ค.

๊ฒฝ๋กœ๊ฐ€ ์—†์„ ๊ฒฝ์šฐ ์ง€์ •ํ•œ ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ํ˜„์žฌ ๋””๋ ‰ํ† ๋ฆฌ์— ๋งŒ๋“ค์–ด์ง‘๋‹ˆ๋‹ค.

Error codes:

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 ' Does the directory exist ?

        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 ) 'Delete all attributes

    MsgBox sFile & Chr(13) & GetAttr( sFile ),0,"์ƒˆ ํŒŒ์ผ ์†์„ฑ"

    Kill sFile

    RmDir sDir1 + "/" + sSubDir1

End Sub

 

' Converts a system path in 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

    ' the colon with DOS

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

    If iPos > 0 Then Mid( fSysFp, iPos , 1,"|")

    fSysURL = "file://" & fSysFp

End Function