Files inside of folders creation

Problem description:
Cannot create files with forward slashes
image

Expected behavior:
When I create a file with forward slashes, it should create the folders respecting the text inside of the slashes, then the file inside of the folder(s)

Actual behavior:
image

Steps to reproduce:
Do what I did

Bug appears at this link:
Workspace

Browser: Firefox Nightly 118.0a1 (2023-08-19) (64-bit)
OS: Windows 11 22H2
Device (Android, iOS, n/a leave blank): PC
Plan (Free, Hacker, Pro Plan): Hacker

4 Likes

Moved this to Feature Requests cause it seems like it was intended that you can’t create files with slashes in the name

2 Likes

I think it’s a bug, most editors have this feature.

1 Like

Well, creating files with slashes in the name isn’t the point of the post, it’s explaining if I had a was creating a file called /folder1/folder2/+page.svelte it would create the +page.svelte file in the /folder1/folder2 directory. For example, editors like http://code.visualstudio.com have.

1 Like

It doesn’t classify as a bug imo :slightly_smiling_face: it was obviously intentional that the “File names cannot include forward slashes” message showed up. Bugs are when something unexpected happens, and, well, Idk Replit’s source code, but it is probably expected that message showed up.

which is exactly why this is a Feature Requests and not a Bug Reports

1 Like

Yeah, this has unfortunately never been a feature, but has been requested quite a few times to no avail unfortunately.

2 Likes

Files cannot have forward slashes on Windows or Linux (or probably any OS) because forward slashes are often used to navigate directories and filepaths. Creating this feature would mean Replit would have to change the slash to something else before storing it on their Linux server, then convert that character back into a slash before displaying in the editor. There is a unicode character which looks like a slash but is not and that works, but you can’t type that from a keyboard so that wouldn’t be a practical solution.

1 Like

This does not mean creating files with slashes in the name, but creating folders if there are slashes in the name of the file being created. For example: when creating the static/style.css file, the static folder was created, and the style.css file was created in it.

4 Likes

Either one is problematic. No files or folders can have slashes in their names because a slash indicates a directory level in the filetree.

1 Like

Well they’re not supposed to. This feature request is so when you create a file static/style.css it should create the static directory and put the style.css file inside of it.

3 Likes

I must have misunderstood something. Thanks for clarifying.

4 Likes

@bddy thanks for the feedback! this should be possible now

2 Likes

Lol you misunderstood the whole thing

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.