I need your help.
I’d like to be able to have a file naming system that would detect if the filename exists and if it does automatically add a number at the end of it. Starting at 2
ie.
var myString = "2011-1234567";
myString = myString + "-2";
if (2011-1234567-2 already exists) then output new file number as: 2011-1234567-3
so id like to ideally be able to create a function that would automatically add a number at the end of it if the filename already exists
Running
new_name("tommy"), gives “tommy-2”.new_name("tommy-2")– “tommy-3”, etc. Of course you need to define your own vision of “exists” infile_existsfunction.