Wiki source for dirDelete

Show raw source

======**sqInt dir_Delete(char *pathString, sqInt pathStringLength)**======

pathString directory path name to delete in image encoding
pathStringLength length of name

**return**: return 1 for success, 0 to make primitive fail.
**From**: Interpreter, filePlugin
to delete a directory

Delete the directory entry if the path name encoded is correct and within file system rules.
Platform must ensure length of path does not violate some internal path length rule for the operating system
Obviously need permission to delete, otherwise prim fails
If Directory contains files/directories it is not deleted

Clone of unix, but it works with Finder Aliases.

See iPhone

We must ensure the directory entry count is zero because the file manager removeItemAtPath: WOULD recursively remove all entries, but we don't want that, we want the smalltalk code to be responsible for removal of any files/directories within the directory.

Check path length, and confirm we can convert path from squeak representation to operating system needs.
Uses rmdir, so the directory must be empty. Also has to invalidate the directory being iterated over by dir_Lookup and close it if needbe.

use RemoveDirectoryW


Valid XHTML :: Valid CSS: :: Powered by WikkaWiki