Most player's antivirus will prevent certain file operations, because to an antivirus there is no difference between a HTML5-game modifying files and a website infecting the computer with a virus.
Because that is how the websites do that - writing on your computer without your knowledge.
And depending on the specific computer's security settings that might be blocked completely.
Just for clarification: in your other topic you asked for creating a file, not modifying an existing file. Modifying requires reading the file, and that is blocked again to prevent spying compared to writing a new file.
That's not really true, as least when it comes to save data.
In case of browser games, you're of course not allowed direct access to the user's filesystem, but you don't need it. Save data is stored in the browser's localstorage, to modify it you interface with the browser in exactly the save way as when saving/loading the game. Every website has complete control over its data that's stored there.
In case of local games, if a user somehow had antivirus settings this aggressive they wouldn't be able to save the game in the first place. In order to save the game in an existing slot, you need to:
1.
Read the contents of that file
2.
Create a new file that's a backup of the existing one (in case the next step fails midway)
3.
Overwrite the existing file with new save data
4.
Delete the backup file (if step 3 was successful)
Manipulating these files the way OP asks for is no different. In fact, they can probably do this using existing functions for loading and saving the game.
That and you if weren't allowed to read files, your game wouldn't be able to start in the first place
With that aside, I think the simplest way to do this is to use an autosave plugin if you don't want to use JavaScript for it. Instead of duplicating the save file, deleting the original and modifying the new one, simply modify the existing one and force a save with an autosave plugin. For added effect you can use plugins that modify how saves look like to make it appear as if the enemy saved the game and not the player.