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?


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. Jan 26 '18 at 10:31
  • "Delete then rewrite" is a bit odd, but the general concept of replacing a file entirely with an edited version is still a thing, e.g. stackoverflow.com/questions/2705076/…
    – natevw
    Mar 16 '20 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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