It would be a bad design decision to use a file for doing this, because it will add delays to the response, you'd need to work out how to lock the file if you get concurrent requests to update a value, you'd need to make sure your file paths are consistent, you'd need to make sure your file can be read by the running virtual service in a test lab when your user updating it is in a different location with no shared file system, etc, and we have both memory maps and a database built-in to DevTest that can do this out-of-the-box.
So you want to keep count in a virtual service? gives instructions and examples of doing this by storing data in a virtual service, storing data in a shared map inside the VSE, storing data in the DevTest database, and updating that data with values from virtual services.
There are REST APIs and Java APIs to interact with the data if you select Persistent or Shared Model Maps. I suppose you could even create a virtual service that creates a web form to allow users to inspect and update values from a browser, but you'll need someone more familiar with creating web pages than me to make this.
Rick