LibreOffice 24.8 Help
āĻāĻāĻāĻŋ āĻĄāĻžāĻāĻž āĻŽāĻžāĻ§ā§āĻ¯āĻŽā§ āĻ¨āĻ¤ā§āĻ¨ āĻāĻāĻāĻŋ āĻĄāĻŋāĻ°ā§āĻā§āĻāĻ°ā§ āĻ¤ā§āĻ°āĻŋ āĻāĻ°āĻž āĻšā§āĨ¤
MkDir path
path: Any string expression that specifies the name and path of the directory to be created. You can also use URL notation.
āĻ¯āĻĻāĻŋ āĻāĻāĻāĻŋ āĻĒāĻžāĻĨ āĻ¨āĻŋāĻ°ā§āĻ§āĻžāĻ°āĻŋāĻ¤ āĻ¨āĻž āĻĨāĻžāĻā§ āĻ¤āĻžāĻšāĻ˛ā§ āĻŦāĻ°ā§āĻ¤āĻŽāĻžāĻ¨ āĻĄāĻŋāĻ°ā§āĻā§āĻāĻ°āĻŋāĻ¤ā§ āĻāĻ āĻĄāĻŋāĻ°ā§āĻā§āĻāĻ°āĻŋāĻāĻŋ āĻ¤ā§āĻ°āĻŋ āĻšāĻŦā§āĨ¤
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
' āĻāĻāĻ āĻĄāĻŋāĻ°ā§āĻā§āĻāĻ°ā§āĻ¤ā§ āĻĒā§āĻ¨āĻ°āĻžāĻ¯āĻŧ āĻ¨āĻžāĻŽāĻāĻ°āĻŖ āĻāĻ°ā§āĻ¨
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