Path/Directory System

Hey! I made a path system that uses a table to store the directories. You can add directories, change directories, add data to a directory, and print the full list of the directory.

This is the code that adds a player’s name to the directory, and prints the current directory and the full list.

local directory = require(script.Directory).new()

directory:cd("Users/")

game.Players.ChildAdded:Connect(function(player)
	directory:add(player.Name)
	print(directory:cwd())
	print(directory:tree())
end)

image

Should I release this as a resource?
  • Yes
  • No

0 voters

If no, tell me why. Feel free to give feedback!

3 Likes

Could you elaborate on what this does? Is it like a waypoint system? A path for NPCs? Or something different?

You know the file system on your computer? Like C:/Users/blah/Documents, etc.? It’s like that. You can create directories. I plan on making it where you can store scripts in there (it would just store the source).

1 Like

so is it suppose to be like GetFullName()?, which returns the children / ancestor until object.

print(Workspace.Model.Part:GetFullName()) --> Workspace.Model.Part

Kind of, except I made my own implementation of the Windows file system.

Wait if all it’s doing is taking a string. and adding ‘C://’ to it, can’t you just add it? or is there something i’m missing xd.
(seems a bit unnecessary to have an entire module for editing a string lol)

It’s not editing a string. If you actually read the post, you would understand.

There’s a table called DIRECTORY. This is an example of what it might look like:

local DIRECTORY = {
      [“C://“] = {
         [“Users”] = {
            “playerhere”
         )
       }
   }

Is this system just a glorified :GetFullName()?

1 Like

I honestly can’t tell if you’re trolling. It’s an attempt of an implementation of the Windows file system in roblox. Read the post.

I did read the post, and understood it has the windows file directory system in roblox, but the way you showed it functions just like Instance:GetFullName(). Which looks like a interesting preference for your codebase rather than a resource

It’s not. I plan to make it where you can store information inside the directories like script sources, instance properties, etc.

This is actually pretty cool. But how will files be read?

Just by reading the data in the table. All files are in a hierarchy in a table.

1 Like