Jump to content

Recommended Posts

Posted

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.

Posted (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 by Lt Dan's legs
Forgot (vl-load-com)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...