Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I was helped with creating folders in couple years ago.
It works fine for me and I never go back to look at it again until now.
I noticed that if the new folder name contains a decimal point, all characters after the decimal will lose in the folder name.
For example:
(makepath "C:/ABC.DEF")
It returns "C:/ABC\\"
In other words, the new folder is "ABC" instead of "ABC.DEF"
I have looked the code below but cannot figure it out.
Your help is much appreciated.
(defun makepath (path / temp items item dir) (setq path (if (= (type path) 'STR) (vl-string-right-trim "/\\" path) nil)) (while (and path (/= temp path)) (setq items (cons (vl-filename-base path) items) temp path path (vl-filename-directory path) ) ) (while (setq item (car (setq items (cdr items)))) (setq dir (strcat path item)) (if (or (vl-directory-files path item -1)(vl-mkdir dir)) (setq path (strcat dir "\\")) (setq items (prompt (strcat "\nUnable to create directory \"" dir "\"\n"))) ) ) )
Please mark "Accept as Solution" and "Like" if my reply resolves the issue and it will help when others need helps.
= ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ =
A circle is the locus of a cursor, starting and ending at the same point on a plane in model space or in layout such that its distance from a given coordinates (X,Y) is always constant.
X² + Y² = C²
= ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ = ♪ = ♫ =
A circle is the locus of a cursor, starting and ending at the same point on a plane in model space or in layout such that its distance from a given coordinates (X,Y) is always constant.
X² + Y² = C²
Solved! Go to Solution.