home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 14 Text / 14-Text.zip / srcsafe.zip / QA_RO.ZIP / QA_RO.TXT < prev   
Text File  |  1993-11-15  |  4KB  |  79 lines

  1. SourceSafe Q & A: Read-Only Files
  2.  
  3. ** SourceSafe Question **
  4.  
  5. Some of the files in my local directory have been tagged so that the operating
  6. system will not let me change or delete them.  When and why does SourceSafe do
  7. this?
  8.  
  9. ** The Basic Answer **
  10.  
  11. SourceSafe works, in general, by the following rules.
  12.  
  13. 1. If you have a file checked out, your local copy is writable (ie the file can
  14. be modified).
  15.  
  16. 2. If you do not have a file checked out, your local copy is not writable
  17. (cannot be modified).
  18.  
  19. The exact method of making a file "not writable" varies with the operating
  20. system: a DOS file is made read-only, a Macintosh file is locked, and a UNIX
  21. file has write permission turned off for all users.  But the basic idea is
  22. always the same: when you do not have a file checked out, SourceSafe tags the
  23. file unmodifiable.  Hence, SourceSafe commands such as Add, Update, Uncheckout,
  24. and Get leave your file read-only; Checkout makes it writable.
  25.  
  26. ** Why SourceSafe Makes Files Read-Only **
  27.  
  28. The first important point to understand here is that making files read-only is
  29. not for security purposes.  SourceSafe is not trying to prevent you forcefully
  30. from modifying the file.  If you Get a file, and then manually make it writable
  31. and start making changes, you have not endangered SourceSafe's Checkout system.
  32.  (Remember, the true "master" copy of every file is in SourceSafe; and
  33. SourceSafe will not let you Update a file that you do not personally have
  34. checked out, regardless of its read-only status!)
  35.  
  36. That being said, there are two principal reasons SourceSafe locks your local
  37. copy of a file.
  38.  
  39. 1. The read-only attribute serves as a reminder to the user that the file is
  40. not checked out.  Most editors will alert you when you try to modify a read-
  41. only file, thus reminding you to Checkout the file before modifying it.  This
  42. can save you the great agony of spending hours modifying a file, only to
  43. discover that you forgot to check it out!
  44.  
  45. 2. The read-only attribute serves as a signal to SourceSafe of whether you have
  46. been modifying a file.  When a file is read-only, SourceSafe assumes that the
  47. file is safely in SourceSafe; hence, when you attempt to Get the file,
  48. SourceSafe will cheerfully overwrite your local copy.  But a writable file may
  49. be one you have checked out, or which you have set writable and modified, and
  50. may therefore contain information which exists nowhere else; by default,
  51. SourceSafe will never overwrite such a file.
  52.  
  53. ** Changing SourceSafe's Use of Read-Only Files **
  54.  
  55. The behavior described above is SourceSafe's default behavior; however, like
  56. most assumptions made by SourceSafe, this can be changed if your needs are
  57. different.  There are two ways to modify SourceSafe's use of read-only files.
  58.  
  59. The first is through the SS.INI variable Use_Readonly.  If the following line
  60. is placed in your SS.INI file, SourceSafe will never tag files read-only.
  61.  
  62. Use_Readonly = No
  63.  
  64. This line signals SourceSafe never to make a file read-only, and not to use the
  65. read-only attribute as its signal that a file should not be overwritten. 
  66. (SourceSafe will use the file's actual Checkout status in this case.)  As with
  67. all INI variables, this can be set per-user in SS.INI or globally in
  68. SYSTEM.INI; and it can be set project-by-project or generally.  See the
  69. description of SS.INI in the SourceSafe User's Manual or On-Line Help for more
  70. details.
  71.  
  72. The other option, available from the SourceSafe command-line only, is to change
  73. SourceSafe's use of the read-only flag for an individual command.  This is done
  74. via the -W (writable) parameter.  If you use the -W with a command such as Get,
  75. Add, or Update, which would normally tag a file read-only, the file will be
  76. made writable.  If you have Use_Readonly set to No by default, you can use the -
  77. W- parameter to override it for an individual command and make the file read-
  78. only.
  79.