Page 1 of 1 1
Topic Options
#11086 - 2001-08-02 04:44 AM How do I modify file attributes through script?
Anonymous
Unregistered


I need to replace a couple of files on about 250 workstations. I know how to do this through the script but these particular files are read only. If I remove the read attribute from the file on the workstation manually, I can delete and copy through the script. I haven't figured out how to remove the attribute through the script though but am sure it can be done. Any suggestions?
Top
#11087 - 2001-08-02 04:55 AM Re: How do I modify file attributes through script?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hi hfv

How about this:

$filename = "d:\test.txt"

$=setfileattr($filename,getfileattr($filename)-1)

-Shawn

Hey hfv - they still got Billy-Bob's Texas down there in Ft. Worth - Awesome bar !!!

[ 02 August 2001: Message edited by: Shawn ]

Top
#11088 - 2001-08-02 08:08 PM Re: How do I modify file attributes through script?
Anonymous
Unregistered


Shawn,

I tried your suggestion, did not work. Is there something missing in the second line?

Top
#11089 - 2001-08-02 08:19 PM Re: How do I modify file attributes through script?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
hfv,

I tried this on Win98 - you running NT ?

What version kix ?

-Shawn

Top
#11090 - 2001-08-02 08:38 PM Re: How do I modify file attributes through script?
Anonymous
Unregistered


Yes, NT and KixTart vs. 3.63
Top
#11091 - 2001-08-02 08:47 PM Re: How do I modify file attributes through script?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
What gets displayed if you place this:

?"ERROR @ERROR : @SERROR"

after the setfileattr() line ?

Access is denied ?

Something else ?

-Shawn

Top
#11092 - 2001-10-24 11:35 PM Re: How do I modify file attributes through script?
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Take a look at our topic on the beta forum
http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=3&t=000014
which handles about timings problem between flushing output and setting file
attributes.
greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#11093 - 2001-10-24 11:42 PM Re: How do I modify file attributes through script?
Anonymous
Unregistered


MCA,

Thanks for the pointer... I solved the problem of setting attributes on files, am on to other things now..

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 696 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.053 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org