Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Manage files using Lips-routines

4 REPLIES 4
Reply
Message 1 of 5
gbra
342 Views, 4 Replies

Manage files using Lips-routines

Hello,

Are there any Lisp functions to copy, rename and/or delete external files (not esp. drawings, could also be e.g. text files)?
4 REPLIES 4
Message 2 of 5
jggerth1
in reply to: gbra

take a look at the doslib library functions from McNeel.com
Message 3 of 5
Anonymous
in reply to: gbra

(vl-file-delete filename)
Arguments

filename
A string containing the name of the file to be deleted. If you do not
specify a full path name, vl-file-delete searches the AutoCAD default
drawing directory.

Return Values

T if successful; nil if delete failed.

Examples

Delete newauto.bat:

_$ (vl-file-delete "newauto.bat")
nil
Nothing was deleted because there is no newauto.bat file in the AutoCAD
default drawing directory.

Delete the newauto.bat file in the c:\ directory:

_$ (vl-file-delete "c:/newauto.bat")
T
The delete was successful because the full path name identified an existing
file.
Message 4 of 5
Anonymous
in reply to: gbra

(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")
T
NoteIf the target file already exists, this function fails.
Message 5 of 5
gbra
in reply to: gbra

Thanks!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost