Nov 30, 2013

How to fix Perforce error "Can't clobber writable file"

Perforce throwing below error while trying to remove folder from workspace

Error:
 Can't clobber writable file C:\thiagu\Perforce\thiagu_p4server.net_1333\dev-app\Application.Properties

Solution:
when you try to sync a file, perforce expects your files in workspace will have read-only permissions. But if a file is not checkout,(by p4 edit)but has write permission then it will throw the above error. Changing the file to read-only and syncing again will solve the issue. or try removing the workspace and get the latest revision again

6 comments:

  1. You can run:
    p4 -c sync -f

    This should take care of any files set writable without p4 edit.

    ReplyDelete
  2. p4 -c sync -f

    '-c' switch is for changing client/machine name instantly
    '-f' for forceful sync

    ReplyDelete
  3. Very useful.. Thanks!

    ReplyDelete
  4. If you're using p4v, you can also allow clobbering of files by going to Connections > Edit Current Workspace > Advanced and check the Clobber checkbox.

    ReplyDelete