LISP to remove file read only status if present

LISP to remove file read only status if present

Jason.Rugg
Collaborator Collaborator
1,091 Views
2 Replies
Message 1 of 3

LISP to remove file read only status if present

Jason.Rugg
Collaborator
Collaborator

I have the following lisp routine that creates a PDF. This lisp is also used in a script file used by AutoScript to batch PDF large amounts of drawing files. The problem is since our drawings are stored in Vault you have to remember to check out the drawings or through Windows Explorer remove the file read only attribute before AutoScript can do the batch process. Is there code that can be added to lisp below that can check for the read only status and if present remove it and then set it back after the file has been processed?

 

 

;(defun c:BPDF nil

(if (= 0 (getvar 'pstylemode))

(vl-cmdf "_.Convertpstyles")

)

(command "tilemode" "0")

(command "-plot" "Yes" "" "DWG To PDF.pc3" "ANSI expand B (11.00 x 17.00 Inches)" "Inches"

"Landscape" "No" "Extents" "Fit" "Center" "Yes" "KCI-monochrome.ctb" "No" "No" "Yes" "No"

(strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) ".pdf") "No" "Yes")

(princ)

; )

0 Likes
1,092 Views
2 Replies
Replies (2)
Message 2 of 3

scot-65
Advisor
Advisor
+/- LISP only works when the editor is open.
Where you need to investigate is inside the batch-type process (BAT).

Here is one place...
http://www.trytoprogram.com/batch-file-commands/#attrib

???

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 3 of 3

john.uhden
Mentor
Mentor

I don't (nor do I care to) understand your sequence of actions, but I do know that DOSLIB has a dos_attrib (or maybe that's dos-attrib) function that can remove the read-only status of a given file including path.  It may also be possible to use the MS-DOS ATTRIB command in a shell command.

John F. Uhden

0 Likes