jda823 Posted April 26, 2012 Posted April 26, 2012 I am looking for a way to check to see if a file is writeable on a unix server. I originally started writing a lisp to check to see if the file was read only, but quickly realized it would not work as I had intended. The cad operator does not have write access to this folder, so everything will be seen as 'read only'. I would like to check a file on the server (the output/plot of the cad file) which can be a pdf, jpg, ect. is read only or not via the NFS permissions on the file. Is there a way via Lisp, VLisp or other to check the mode on the file to see what permissions the User/Group/other have? I would like to use this as a way to alert the cad operator that they need to create a new revision of the file that they are working on because the output file has already been delivered to the customer. (I apologize if I did not use the right words in reference to the file permissions, as I am not very familiar with that type of thing) Just looking for a direction to go into to handle this if it is possible. Thanks. Quote
Lt Dan's legs Posted April 26, 2012 Posted April 26, 2012 (edited) Checkout attributes, or in windows it's Bit Depth (look in the summary of the file properties) (defun c:test ( / app file at ) (vl-load-com) (if (setq file (getfiled "Directory" "" "" 16)) (progn (setq app (vlax-get-or-create-object "Scripting.FileSystemObject")) (setq file (vlax-invoke app 'getfile file)) (setq at (vlax-get file 'attributes)) (vlax-release-object app)(gc) (alert (itoa at)) ) )(princ) ) Edited April 26, 2012 by Lt Dan's legs Forgot (vl-load-com) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.