September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
|
|
@ -0,0 +1,5 @@
|
|||
Public Sub Form_Open()
|
||||
|
||||
If Not Exist(User.home &/ "TestFolder") Then Mkdir User.Home &/ "TestFolder"
|
||||
|
||||
End
|
||||
10
Task/Make-directory-path/Kotlin/make-directory-path.kotlin
Normal file
10
Task/Make-directory-path/Kotlin/make-directory-path.kotlin
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
// version 1.0.6
|
||||
|
||||
import java.io.File
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
// using built-in mkdirs() method
|
||||
val success = File("./path/to/dir").mkdirs()
|
||||
if (success) println("Directory path was created successfully")
|
||||
else println("Failed to create directory path")
|
||||
}
|
||||
3
Task/Make-directory-path/Phix/make-directory-path-1.phix
Normal file
3
Task/Make-directory-path/Phix/make-directory-path-1.phix
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
if not create_directory("myapp/interface/letters") then
|
||||
crash("Filesystem problem - could not create the new folder")
|
||||
end if
|
||||
37
Task/Make-directory-path/Phix/make-directory-path-2.phix
Normal file
37
Task/Make-directory-path/Phix/make-directory-path-2.phix
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
global function create_directory(string name, integer mode=0o700, bool make_parent=1)
|
||||
bool ret
|
||||
if not finit then initf() end if
|
||||
|
||||
if length(name)=0 then
|
||||
?9/0
|
||||
end if
|
||||
|
||||
name = get_proper_path(name)
|
||||
|
||||
-- Remove any trailing slash.
|
||||
if name[$]=SLASH then
|
||||
name = name[1..$-1]
|
||||
end if
|
||||
|
||||
if make_parent then
|
||||
integer pos = rfind(SLASH, name)
|
||||
if pos!=0 then
|
||||
string parent = name[1..pos-1]
|
||||
if file_exists(parent) then
|
||||
if file_type(parent)!=FILETYPE_DIRECTORY then ?9/0 end if
|
||||
else
|
||||
if not create_directory(parent, mode, make_parent) then
|
||||
return 0
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
|
||||
if platform()=LINUX then
|
||||
ret = not c_func(xCreateDirectory, {name, mode})
|
||||
elsif platform()=WINDOWS then
|
||||
ret = c_func(xCreateDirectory, {name, 0})
|
||||
end if
|
||||
|
||||
return ret
|
||||
end function
|
||||
5
Task/Make-directory-path/Rust/make-directory-path.rust
Normal file
5
Task/Make-directory-path/Rust/make-directory-path.rust
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
use std::fs;
|
||||
|
||||
fn main() {
|
||||
fs::create_dir_all("./path/to/dir").expect("An Error Occured!")
|
||||
}
|
||||
1
Task/Make-directory-path/Zkl/make-directory-path-1.zkl
Normal file
1
Task/Make-directory-path/Zkl/make-directory-path-1.zkl
Normal file
|
|
@ -0,0 +1 @@
|
|||
System.cmd("mkdir -p ../foo/bar")
|
||||
1
Task/Make-directory-path/Zkl/make-directory-path-2.zkl
Normal file
1
Task/Make-directory-path/Zkl/make-directory-path-2.zkl
Normal file
|
|
@ -0,0 +1 @@
|
|||
fcn mkdir(path) { System.cmd("mkdir -p "+path) }
|
||||
Loading…
Add table
Add a link
Reference in a new issue