Ask coding questions

← Back to all posts
Change the Name of

I'm using Replit Teams for Education to make assignments for students, and evaluate them using Unit Tests. I'd like them to be able to rename the file to something more meaningful for our applications. Is this possible? The students are sometimes inexperienced, so I'd hate for them to have to go in and make changes through the command line. I'd rather it be delivered to them with the name already changed.


You must be getting an error when you change the file name right?

This is because replit is configured to run a file named in the shell. So if you change the name to something else, replit can't find, so it throws an error.

To fix this, you have to create a .replit file, and put in this command:

This will run the desired filename, no matter what the name is of the file. You can even attach multiple language files in one repl.

Hope I was helpful!!!



@OldWizard209 Yes, that solution works, but I can't distribute the .replit file to my students when they fork it. Is there a way to do that?


No, when a repl is forked, all the files/contents of the file are cloned into another repl. So that way, the .replit file will be forked. You can try that by creating a .replit file and forking the repl yourself. @skacprowicz


@OldWizard209 Ah, ok. Yes, I just had a new student fork the assignment, and the files were distributed. I guess it didn't update for the first student, since the .replit file wasn't there when they had originally forked the assignment. Thanks all!!


You can create a Bash repl that runs that Java file...