fixes #2792 - only touch if writable


fixes #2792 - only touch if writable

@icewind1991 @Raydiation @karlitschek @schiesbn  THX