Don't assume you can write to a file

Project:Prolint Issue Tracker
Component:Code
Category:feature request
Priority:normal
Assigned:jurjen
Status:closed
Description

A trend I've noticed in software development is that more and more companies are putting their developers in locked-down, controlled environments where they can't change anything about the tools they use. For example using WTS or Citrix to connect to a box where Progress and the other tools are installed.

In a situation like that the programmer may not be able to write to protools.dat, and so prolint will give you an error if you click on the "Add to protools" button from the desktop. As a simple fix you can add this code to add2protools.p, just before the line 'IF cAction = "ADD":U THEN'

file-info:file-name = ProtoolsDatfile.
if lookup("W",file-info:file-type) = 0 then
AlreadyInThere = true.

This is not the most elegant fix but it does work, causes the button to not appear if the user can't write to the file.

I've also seen environments where the developers can't write to the registry on the machine's they're working on, causing every put-key-value to give an error. I've started adding "no-error" to put-key-value as a habit, you might want to consider that also.

-Tim Townsend


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jurjen's picture

#1

Assigned to:Anonymous» jurjen
Status:active» fixed

Thanks! I have followed your instructions and changed add2protools.p, and added NO-ERROR to every PUT-KEY-VALUE statement. This is checked in into Subversion as revision 328.

This should become a new rule: check if every PUT-KEY-VALUE statement has the NO-ERROR option. I will create a feature request to the issue tracker, so it is documented.

Thanks again!


#2

Status:fixed» closed