Setting file attributes on windows. 
Author Message
 Setting file attributes on windows.

I have read the documentation on the [file] command which shows the
syntax to change a file attribute under windows to be:

file attributesname ?option value option value...?

Can somebody give me an example of what "value" would be to change a
files attribute to readonly?  I also do not understand what "name" is.
Is this the file path and name?  And if so, is it really supposed to be
butted up against the word attribute or is that a typo in the docs.
The documentation seems to be confusing at best.

All I want to do is temporarily remove the readonly attribute for a
file so I can copy another file over it, and then set that file back to
readonly.

Thanks,

Daniel Alexander

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sun, 30 Jun 2002 03:00:00 GMT  
 Setting file attributes on windows.


Quote:
>I have read the documentation on the [file] command which shows the
>syntax to change a file attribute under windows to be:

>file attributesname ?option value option value...?

>Can somebody give me an example of what "value" would be to change a
>files attribute to readonly?  I also do not understand what "name" is.
>Is this the file path and name?  And if so, is it really supposed to be
>butted up against the word attribute or is that a typo in the docs.
>The documentation seems to be confusing at best.

                        .
                        .
                        .
Examples are good.  That's much of the charm of the *Tcl/Tk Pro-
grammer's Reference* <URL:http://www.purl.org/net/TclTkProgRef/>.
Chris took a lot of care in preparing meaningful examples for
this book, which should be the first place you look when you have
such a need.

... unless you happen not to have a copy on hand and think the
question would interest c.l.t.  For this case, Chris offers no
examples, but his Table 2.16, "Microsoft Windows File Attributes",
tells us
  -readonly   A 0 or 1 representing the read-only bit for the file.

You're right that the correct formula is
  file attributes name ...
and that "name" is the file name, qualified as much or as little
as you choose (either {MYFILE} or {C:\TEMP\WORKING\MYFILE}, for
example).
--


Business:  http://www.Phaseit.net
Personal:  http://starbase.neosoft.com/~claird/home.html



Sun, 30 Jun 2002 03:00:00 GMT  
 Setting file attributes on windows.

Quote:
> I have read the documentation on the [file] command which shows the
> syntax to change a file attribute under windows to be:

> file attributesname ?option value option value...?

> Can somebody give me an example of what "value" would be to change a
> files attribute to readonly?  I also do not understand what "name" is.
> Is this the file path and name?  And if so, is it really supposed to be
> butted up against the word attribute or is that a typo in the docs.
> The documentation seems to be confusing at best.

typo.

Quote:
> All I want to do is temporarily remove the readonly attribute for a
> file so I can copy another file over it, and then set that file back to
> readonly.

file attributes myfile.txt -readonly 0

to remove readonly attributes

file attributes myfile.txt -readonly 1

to reinstate. What I've found as a generally useful way to interactively
determine how to use a command is to give a bunch of bogus information and
reading the error message. So something like this:

file asdfasdf

would give you the syntax of file attributes. I use this technique pretty
often with clock since I'm always forgetting how to use the command
properly.

L

--
Penguin Power!           Nothing I say reflects the views of my employer


CGI - FWFM Project                                 Phone: (514) 350-3368



Sun, 30 Jun 2002 03:00:00 GMT  
 Setting file attributes on windows.
Thanks, that works like a charm.  Apparently there are some
typo/formatting problems in the tcl windows help file where it shows
the syntax.

Btw

In article


Quote:


> >I have read the documentation on the [file] command which shows the
> >syntax to change a file attribute under windows to be:

> >file attributesname ?option value option value...?

> >Can somebody give me an example of what "value" would be to change a
> >files attribute to readonly?  I also do not understand what "name"
is.
> >Is this the file path and name?  And if so, is it really supposed to
be
> >butted up against the word attribute or is that a typo in the docs.
> >The documentation seems to be confusing at best.
>                    .
>                    .
>                    .
> Examples are good.  That's much of the charm of the *Tcl/Tk Pro-
> grammer's Reference* <URL:http://www.purl.org/net/TclTkProgRef/>.
> Chris took a lot of care in preparing meaningful examples for
> this book, which should be the first place you look when you have
> such a need.

> ... unless you happen not to have a copy on hand and think the
> question would interest c.l.t.  For this case, Chris offers no
> examples, but his Table 2.16, "Microsoft Windows File Attributes",
> tells us
>   -readonly   A 0 or 1 representing the read-only bit for the file.

> You're right that the correct formula is
>   file attributes name ...
> and that "name" is the file name, qualified as much or as little
> as you choose (either {MYFILE} or {C:\TEMP\WORKING\MYFILE}, for
> example).
> --


> Business:  http://www.Phaseit.net
> Personal:  http://starbase.neosoft.com/~claird/home.html

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 30 Jun 2002 03:00:00 GMT  
 Setting file attributes on windows.

Quote:
> Thanks, that works like a charm.  Apparently there are some
> typo/formatting problems in the tcl windows help file where it shows
> the syntax.

I think it's a problem with the conversion software.

L

--
Penguin Power!           Nothing I say reflects the views of my employer


CGI - FWFM Project                                 Phone: (514) 350-3368



Sun, 30 Jun 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Setting file attributes and Copying files

2. Setting file attributes on file creation from ZipFiles (solved)

3. Setting file attributes on file creation.

4. How do I set a text file's attributes to read-only

5. Setting Extended Attributes for files under OS/2.

6. Setting file attributes in ADA 95

7. TIP #222: Add [wm attributes -alpha] Attribute on Windows

8. Obtaining the Archive Attribute of a File on Windows Systems

9. Module to access file attributes for Windows?

10. setting files in windows ME ???

11. HOW TO SET FILES=150 IN WINDOWS XP

12. WINDOWS 95. SET FILE=XX error

 

 
Powered by phpBB® Forum Software