Save Function not working

I have a save function that for some reasons brings up a Compile error.

	public static void saveProgress(string saveName){
		BinaryFormatter bf = new BinaryFormatter ();
		string tempString = Application.persistentDataPath + "/" + saveName + ".dat";
		FileStream fs = File.Create(tempString, FileMode.Create); 
		bf.Serialize (fs, GameState.getInstance());
		fs.Close ();
	}

The error message I get is this:

**Assets/SaveGame.cs(22,38): error CS1502: The best overloaded method match for `System.IO.File.Create(string, int)’ has some invalid arguments
**

But it’s strange because I’m passing in a string and what I assume to be an int in the from of FileMode.Create. Any help would be greatly appreciated.

No, you’re passing in a string and a FileMode…

The second parameter passed to File.Create needs to be an int representing the number of bytes to write to the file: File.Create Method (System.IO) | Microsoft Learn