TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: laidbacklarry on October 04, 2011, 11:37:20 AM

Title: Rename directory with vlisp?
Post by: laidbacklarry on October 04, 2011, 11:37:20 AM
I know this can be done with dos_rendir from doslib, but we'd like to port all doslib functions (that we use) to lisp. This  is the only one we're stuck on... Thanks for any help
Title: Re: Rename directory with vlisp?
Post by: Lee Mac on October 04, 2011, 11:39:57 AM
vl-file-rename
Title: Re: Rename directory with vlisp?
Post by: MP on October 04, 2011, 11:45:04 AM
e.g.

(vl-file-rename "c:\\docs\\rtfm" "c:\\docs\\lol-ok")
Title: Re: Rename directory with vlisp?
Post by: laidbacklarry on October 04, 2011, 11:51:18 AM
Thanks, guys...
Title: Re: Rename directory with vlisp?
Post by: alanjt on October 04, 2011, 12:47:59 PM
e.g.

(vl-file-rename "c:\\docs\\rtfm" "c:\\docs\\lol-ok")
  :-D
Title: Re: Rename directory with vlisp?
Post by: Mark on October 04, 2011, 02:03:56 PM
If you do a search HERE (http://docs.autodesk.com/CIV3D/2012/ENU/acad-search.html) you come up empty if you search for vl-file-rename *shrug*
Title: Re: Rename directory with vlisp?
Post by: alanjt on October 04, 2011, 02:05:53 PM
Code: [Select]
vl-file-rename
 
 
 
Renames a file

(vl-file-rename old-filename new-filename)Arguments

old-filename
A string containing the name of the file you want to rename. If you do not specify a full path name, vl-file-rename looks in the AutoCAD default drawing directory.

new-filename
A string containing the new name to be assigned to the file.

NoteIf you do not specify a path name, vl-file-rename writes the renamed file to the AutoCAD default drawing directory.
Return Values

T, if renaming completed successfully; nil if renaming failed.

Examples

_$ (vl-file-rename "c:/newauto.bat"
"c:/myauto.bat")TNoteIf the target file already exists, this function fails.
Please send us your comments about this page

Title: Re: Rename directory with vlisp?
Post by: Lee Mac on October 04, 2011, 02:16:45 PM
If you do a search HERE (http://docs.autodesk.com/CIV3D/2012/ENU/acad-search.html) you come up empty if you search for vl-file-rename *shrug*

http://docs.autodesk.com/ACD/2011/ENU/filesALR/WS1a9193826455f5ff1a32d8d10ebc6b7ccc-68c5.htm (http://docs.autodesk.com/ACD/2011/ENU/filesALR/WS1a9193826455f5ff1a32d8d10ebc6b7ccc-68c5.htm)
Title: Re: Rename directory with vlisp?
Post by: Mark on October 04, 2011, 03:01:21 PM
So RTFM would have been absolutely useless to the OP.
Title: Re: Rename directory with vlisp?
Post by: MP on October 04, 2011, 04:18:18 PM
The rtfm was offered purely for levity, hope it was taken same. Unfortunately Autodesk authors their help much like the Microsoft docs, insomuch as sometimes things are implied or just left out. For example the MoveFolder method of the File System Object can be used to rename a folder but the docs don't reveal that. Chocolate chips cookies for every one in the thread.
Title: Re: Rename directory with vlisp?
Post by: alanjt on October 04, 2011, 04:20:53 PM
The rtfm was offered purely for levity, hope it was taken same. Unfortunately Autodesk authors their help much like the Microsoft docs, insomuch as sometimes things are implied or just left out. For example the MoveFolder method of the File System Object can be used to rename a folder but the docs don't reveal that. Chocolate chips cookies for every one in the thread.
What's that, you were able to do something with a command that isn't document? Yeah, that's just an undocumented feature we didn't think you plebeians would care to know about.
Title: Re: Rename directory with vlisp?
Post by: jaydee on October 04, 2011, 04:39:16 PM
Something else u might want to consider

http://www.bulkrenameutility.co.uk/Screenshots.php
Title: Re: Rename directory with vlisp?
Post by: MP on October 04, 2011, 04:46:38 PM
No hate, but not sure how this:

(http://www.bulkrenameutility.co.uk/Shots/BRU_Main_Screen.gif)

will help the OP pen alternates for doslib functions.

On another note, that interface gave me an aneurysm. :doa:
Title: Re: Rename directory with vlisp?
Post by: Mark on October 04, 2011, 05:07:57 PM
The rtfm was offered purely for levity, hope it was taken same.
Then I apologize, I took offense to it.

OK, I'll leave now ... *grin*
Title: Re: Rename directory with vlisp?
Post by: MP on October 04, 2011, 05:11:09 PM
My fault, I don't know the audience anymore, so the apologies are mine to make; sorry all.
Title: Re: Rename directory with vlisp?
Post by: Maverick® on October 04, 2011, 05:38:24 PM
My fault, I don't know the audience anymore, so the apologies are mine to make; sorry all.

Accepted.  *skips off humming Queen's "Bicycle"*
Title: Re: Rename directory with vlisp?
Post by: MP on October 04, 2011, 05:48:08 PM
Accepted.  *skips off humming Queen's "Bicycle"*

*takes long bong hit*

"I love you man".
Title: Re: Rename directory with vlisp?
Post by: irneb on October 05, 2011, 02:33:16 AM
On another note, that interface gave me an aneurysm. :doa:
:lmao:

The one I use is makes me "slightly" less nauseas.  ;)

Though not "strictly" part of this thread, I generally use it to rename those DWF/PDF files I generate from publish. I love the Preview idea to see the changes before you actually perform them, makes for less mistakes.