Link to home
Start Free TrialLog in
Avatar of vbhelper
vbhelper

asked on

URJENT :TOUGH ONE:GetAttr and SETATTR ERROR , Help me out

Hello experts,
I hope that you will be able to resolve my problem.

1) why these two behavior occurs and I want to how to workaround for them.?

2)Is  there  any other similar VB function which relies on Windows and can causes similar problem.?


============================================================================
===
[Behavior 1]
============================================================================
===
1) Where the behavior occurs:
In the process where GetAttr obtains the file attribution and then SetAttr
changes the attribution.
2) Problem Behvior
Under the Windows 2000 environment, if GetAttr obtains the attribution which
SetAttr does not support (*1), executing SetAttr results in Runtime Error 5.

*1: 8192(0x00002000) FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
3) Workaround
Changed to use GetFileAttributes, SetFileAttributes.

============================================================================
===
[Behavior 2]
============================================================================
===
1) Where the behavior occurs:
In the process where GetAttr obtains the file attribution from a root
folder.

2) Problem Behvior
Under the Windows 2000 environment, (with GetAttr) an attempt to obtain the
file attribution of hiberfil.sys which exists when the (Power Suspended Status Support]
option is set to ON results in Runtime Error 5.

3) Workaround

Since GetFileAttributes causes the same error, I use the error trap (OnError
Goto) to workaround this behavior.

Although the behavior #1 and #2 have already been workarounded, and these
two behaviors do occur on Windows 2000, I am going to do some research
about my application to check if there is any other potential problem
related to a VB function which relies on Windows like the above listed two
behviors.

Regarding with any VB function problem which relies on the Windows version,
could you guys please tell us what causes the problem, and how I should work it?

Thanks in advance


Avatar of rkot2000
rkot2000

>>> any other potential problem
related to a VB function which relies on Windows like the above listed twobehviors.

I had similar problems with compressed files under NT or 2000.

>>>could you guys please tell us what causes the problem, and how I should work it?

vb supports only the following attributes :

vbNormal 0 Normal (default).
vbReadOnly 1 Read-only.
vbHidden 2 Hidden.
vbSystem 4 System file.
vbArchive 32 File has changed since last backup.


As work around you can do the following :
1.     Get attribute.
2.     I=getattr(??)
3.     Check the attribute using following logic:
4.     if I and vbSystem then

Avatar of Richie_Simonetti
do you have enough permission over those files?
Yes, We have permission to those files.
ASKER CERTIFIED SOLUTION
Avatar of Richie_Simonetti
Richie_Simonetti
Flag of Argentina image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It's time to clean up this topic area and that means taking care of this question. Your options at this point are:
 
1. Award points to the Expert who provided an answer, or who helped you most. Do this by clicking on the "Accept Comment as Answer" button that lies above and to the right of the appropriate expert's name.
 
2. PAQ the question because the information might be useful to others, but was not useful to you. To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
3.  Ask Community Support to help split points between participating experts.  Just comment here with details.
 
4.  Delete the question because it is of no value to you or to anyone else.  To use this option, you must state why the question is no longer useful to you, and the experts need to let me know if they feel that you're being unfair.
 
If you elect for option 2, 3 or 4, just post comment with details here and I'll take it from there.  We also request that you review any other open questions you might have and update/close them.  Display all your question history from your Member Profile to view details.
 
PLEASE DO NOT AWARD THE POINTS TO ME.
 
____________________________________________
 
 
 
Hi Experts:
 
In the event that the Asker does not respond, I would very much appreciate your opinions as to which Expert ought to receive points (if any) as a result of this question.  Likewise, you can also suggest that I PAQ or delete the question.
 
Experts, please do not add further "answer" information to this question.  I will be back in about one week to finalize this question.
 
Thank you everyone.
 
Moondancer :)
Community Support Moderator @ Experts Exchange
vbhelper and gargjapan are duplicate accounts. What is more, they both have a tendency to abandon their questions as soon as they have their answer.

Their accounts have been closed. Which leaves these open questions as so many loose ends.

Of the participants I would like to ask, please advise. Did anyone provide enough info to deserve the points? Or should this question be deleted?

Thank you

modder
Community Support
modder, i don't know what to say.
I would like to let it to your better knowledge :)
Cheers
By the way, all of you are doing great work here.
I am sorry to see that Asker has not returned to update and finalize this question.  I am, therefore, force accepting this question.  In the event the Asker returns with additional needs related to this question, please respond and continue the collaboration process.
Thank you,
Moondancer
Community Support Moderator @ Experts Exchange