Skip to content

Instantly share code, notes, and snippets.

@probablycorey
Created August 11, 2011 17:01
Show Gist options
  • Select an option

  • Save probablycorey/1140188 to your computer and use it in GitHub Desktop.

Select an option

Save probablycorey/1140188 to your computer and use it in GitHub Desktop.
local path = NSDocumentDirectory .. "/SomeDirectoryName"
local err = nil -- use err (instead of error) as the var name because error is a global lua function
if not NSFileManager:defaultManager():fileExistsAtPath(path) then
if not NSFileManager:defaultManager():fileManager:createDirectoryAtPath_withIntermediateDirectories_attributes_error(path, false, nil, err) then
puts("Create directory error %s", err:localizedDescription())
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment