Recently I noticed a strange behavior when editing startup-sequence with ED. Unless I call

protect startup-sequence rwed 

before editing it, ed says unable to write the file. Saving the file removes the d and e flag, and I am unable to edit the file again unless I call the above command. As far as I understand neither d nor e should be required for editing. Why is this?

up vote 5 down vote accepted

I can reproduce the same behavior on my A2500 with Workbench 2.1 and using the built-in AmigaDOS "Ed" command v2.00. The critical bit is the Delete ("d") protection flag. Ed's internal functionality is to delete the file then rewrite it with the modified contents. This operation fails if the "d" bit is cleared. The Execute ("e") protection bit does not matter, only the "d" matters.

Really, if there is a "bug", it's that Ed does not rewrite the file with the same protection bits as before. Instead, it defaults to "rw", which is why you can't edit the file a second time without setting "d" again.

Conclusion: Use 'memacs' instead. It has the same behavior of deleting then rewriting the modified file, but it retains the protection bits from the original file.

  • The way you explained is very logical, It seems the D flag was required because ED wanted to delete and recreate the file. – Peter Szanto Jan 26 at 10:31

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.