Hi,
I'm ussing the following to create a dirctory ussing lisp;
;CREATING NESSESARY DIRECTORYS... (vl-mkdir "C:\\ICT") (vl-mkdir "C:\\ICT\\AutoCAD_Architecture_suit_2012") (vl-mkdir "C:\\ICT\\AutoCAD_Architecture_suit_2012\\CUSTOM") (vl-mkdir "C:\\ICT\\AutoCAD_Architecture_suit_2012\\CUSTOM\\WOOD Clones") (vl-mkdir "C:\\ICT\\AutoCAD_Architecture_suit_2012\\CUSTOM\\WOOD Clones\\PEN")
works nice, but now I want to create an empty fresh txt file in that last directory, this is proving beyond my knowlege even more tricky only if it already dosnt exist.
dose any body know how to acomplish either or both?
Solved! Go to Solution.
Solved by M_Hensley. Go to Solution.
One way to do it would be to open a file for writing then write a carriage return and close it. (This will create a new file or overwrite any file by the same name that may already exist.)
(setq f1 (open "C:\\ICT\\AutoCAD_Architecture_suit_2012\\CUSTOM\\WOOD Clones\\PEN\\myfile.txt" "w"))
(princ "\n" f1)
(close f1)
@The_Caddie wrote:Hi,
I'm ussing the following to create a dirctory ussing lisp;
;CREATING NESSESARY DIRECTORYS... (vl-mkdir "C:\\ICT") (vl-mkdir "C:\\ICT\\AutoCAD_Architecture_suit_2012") (vl-mkdir "C:\\ICT\\AutoCAD_Architecture_suit_2012\\CUSTOM") (vl-mkdir "C:\\ICT\\AutoCAD_Architecture_suit_2012\\CUSTOM\\WOOD Clones") (vl-mkdir "C:\\ICT\\AutoCAD_Architecture_suit_2012\\CUSTOM\\WOOD Clones\\PEN")works nice, but now I want to create an empty fresh txt file in that last directory, this is proving beyond my knowlege even more tricky only if it already dosnt exist.
dose any body know how to acomplish either or both?
(findfile "using your newly created folder for path and filenmae of text to be created")