Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-07-22, 07:31 PM   #1
msretenovic
I could stop if I wanted to
 
msretenovic's Avatar
 
Join Date: 2002-02
Location: Galloway, Oh
Posts: 227
msretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of light
Unhappy Detect Read-Only file attribute

Hello all,

I'm writing a routine and have come across a slight snag. I have this code:

Code:
 
(if (not (vl-catch-all-apply 'vla-open (list dbxDoc dwg)))
  (progn
	;;do my stuff here
	(vla-saveas- dbxDoc dwg)
  )
)
This works really well until I come to a file that is Read-Only . It will do as I expect when the file is Read-Only when someone has it open, but if it's file attribute is Read-Only, it doesn't catch it . Does any know a way around this or how to check to see if a file has a Read-Only attribute ?

TIA
__________________
Michael K. Sretenović
Quote:
Most folks are about as happy as they make up their minds to be.
-Abraham Lincoln (1809-1865)
-16th president of The United States of America (1861 - 1865)
msretenovic is offline   Reply With Quote
Old 2004-07-22, 07:44 PM   #2
Mike.Perry
Administrator
 
Mike.Perry's Avatar
 
Join Date: 2001-03
Location: Fenton, MO via the UK
Posts: 13,500
Mike.Perry has disabled reputation
Default RE: Detect Read-Only file attribute

Hi Mike

Check out the following article by Stig Madsen -

Scripting objects

Way over my head but I'm pretty sure you can/could achieve what you're after using the methods described in the article.

Have a good one, Mike
__________________
..........MeWhee
Mike.Perry is offline   Reply With Quote
Old 2004-07-22, 07:54 PM   #3
RobertB
Administrator
 
RobertB's Avatar
 
Join Date: 2001-08
Location: Seattle WA US
Posts: 4,393
RobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the stars
Default

Here is a simple method too:

Code:
(defun IsRO (fileN / fileH)
 (cond ((setq fileH (open fileN "a"))
        (close fileH)))
 (not fileH))
RobertB is offline   Reply With Quote
Old 2004-07-22, 08:49 PM   #4
msretenovic
I could stop if I wanted to
 
msretenovic's Avatar
 
Join Date: 2002-02
Location: Galloway, Oh
Posts: 227
msretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of lightmsretenovic is a beam of light
Default RE: Detect Read-Only file attribute

Robert,

That is exactly what I was looking for . So simple, yet so effective .



Thanks
__________________
Michael K. Sretenović
Quote:
Most folks are about as happy as they make up their minds to be.
-Abraham Lincoln (1809-1865)
-16th president of The United States of America (1861 - 1865)
msretenovic is offline   Reply With Quote
Old 2004-07-23, 01:02 AM   #5
RobertB
Administrator
 
RobertB's Avatar
 
Join Date: 2001-08
Location: Seattle WA US
Posts: 4,393
RobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the starsRobertB is shooting for the stars
Default

Glad I could help!
RobertB is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Editing attribute layer hbisco AutoCAD General 8 2005-05-13 03:53 PM
Copy Central File B. Strube Revit - Worksharing/Worksets 5 2004-09-24 05:32 PM
Is there any replacement for BatchPlot in Autocad 04 and 05? camncad AutoCAD Plotting 12 2004-06-23 07:37 PM


All times are GMT +1. The time now is 01:33 PM.