/ Published in: Maxscript
URL: http://forums.cgsociety.org/showthread.php?f=98&t=634766
Two ways for determining whether a folder exists
Expand |
Embed | Plain Text
fn doesFolderExist f create:false = -- test whether f exists and is a folder; create it if it doesn't and create==true ( local val val = if (doesFileExist f) and (getfileattribute f #directory) then true else false if not val and create then ( val = makeDir f ) val ) -- alternative using dotNet: ((dotnetclass "System.IO.Directory").exists "D:\\DIRECTORYNAME") ((dotnetclass "System.IO.File").exists "D:\\SOMEDIR\\SOMEFILE.EXT")
You need to login to post a comment.
