How I RUINED My Rust Project
Ойын-сауық
Leo's Portfolio: delta.is-a.dev/
Lemon Foxmere's Github: github.com/LemonFoxmere
Project Repository: github.com/conaticus/fileexpl...
Original Video: • I Made a FAST File Exp...
Join this channel to get access to perks:
/ @conaticus
Discord: / discord
Github: github.com/conaticus
Twitter: / conaticus
0:00 Intro
0:15 Cache Invalidation
1:40 Saving Cache to Disk
2:25 File Opening
2:58 Binary Serialization
3:17 Context Menu
3:36 Create & Delete Files
How I RUINED My File Explorer (in Rust)
Пікірлер: 113
Thanks for checking out the video! Little mistake at 1:27, this is actually the interval for the disk caching. I should really stop editing these at 2am 😅
@and_rotate69
11 ай бұрын
I started learning rust 3 days ago and after seeing that function i thought im so dumb to understand what's going on just from the name, but yaaay im not dumb, i lack confidence
"I'm making a fast file explorer..." *Takes 3min to delete a .txt file* Lmao
@DBZM1k3
11 ай бұрын
Well... he's not make a fast file delete app. Its for exploring. 🙃
@FriedMonkey362
11 ай бұрын
I mean he could just also delete it from the cache as soon as he deletes it, itll look nicer
@samllea1
11 ай бұрын
Floky!!! i have been subbed for a long time! less then 500 i think
@fogbank
10 ай бұрын
Gives you time to reconsider, kinda like GMail waiting 5 secs before actually sending that message you might regret.
For state manager, I usually use a simple state manager like React Recoil instead of full blown one like Redux. It saves a lot of time and effort
@anarchoyeasty3908
11 ай бұрын
When you say time and effort, are you talking about raw redux? Or redux toolkit. In my experience, redux toolkit solves the biggest headaches about redux but I've not really looked into other state management solutions
@johnc0de
11 ай бұрын
Zustand, jotai, valtio, nano store are all good options that seems better than redux or recoil in that occasion
@KangJangkrik
11 ай бұрын
@@anarchoyeasty3908 if you delve into its source code, you'll know the reason why people are looking for alternative like jotai and react-recoil
@arivanhouten6343
11 ай бұрын
I like Zustand since imo it's rather simple to set up and work with. Also provides devtools support
@conaticus
11 ай бұрын
Yeah, I should definitely check those out. Redux is a pain 😂
A React based file explorer. May god have mercy on us
@tacomies
10 ай бұрын
I'd argue that the GUI is not the main point here
@tompov227
10 ай бұрын
@@tacomies I’d argue that I was making a joke
@tacomies
10 ай бұрын
@@tompov227 Can't really tell over text since hating on react is quite common
Look at this guy. It's always fun to see every new programmer step into this Open Source software found + maintainer rabbit hole🤣 I'm crying
Did you say you were caching all files every 30 seconds? Isn’t that going to eat through a disk or ssd’s read counts?
@manishsigdel824
11 ай бұрын
Ssds have read counts? I've almost only ever heard of storage deteriorating on writes only
@AlFredo-sx2yy
11 ай бұрын
@@manishsigdel824 i think that based on the context of the message, it is safe to assume that they were talking about write counts because of the fact that they mentioned "caching all files every 30 seconds", which would mean writing to disk every 30 seconds. Unless i misunderstood what the OP meant.
@juh9870_projects
11 ай бұрын
Just having chrome open will write more than 1 file per 30 seconds
@AlFredo-sx2yy
11 ай бұрын
@@juh9870_projects yep, but that doesnt justify any program doing such a thing. I think its more of a testament to how badly designed chrome is and what a piece of sh*t software it is.
@juh9870_projects
11 ай бұрын
@@AlFredo-sx2yy Except that A LOT of apps do it. 1 file per 30 seconds is not too much in a modern software world
Its a hassle to create cache, store it in memory, update it in the background... Handling all of that without any errors and no significant performance overhead is extremely difficult. You can (and will) get memory errors, out-of-sync problems, concurrency issues, low performance, etc. I dont even need to mention that choosing to use cache and building everything around it so that it works correctly and doesn't get out of sync translates into thousands of extra lines of code, and the more lines of code you have, the more bugs that will be introduced and the more expensive mantaining that codebase is gonna get. You will also have less money / time / motivation to invest in other parts of your project that are equally important like user experience, documentation, security and stability, etc. TLDR: If I were you, I'd drop the cache for the sake of code simplicity and less headaches. PD: Im at 1:43, still havent watched the whole video tho. Let me know if I predicted anything lol
@Afif87123
11 ай бұрын
it's kinda a tradeoff, having a cache really improves file searching (because it's literally walking through all the files) even though it's pain in the ass when you were there to add a new feature (or fix an existing bug)
Something that someone may or may not have mentioned is that, for any filesystem (on Windows at least), you cannot delete folders directly just like that. Have you ever noticed that programs delete the subfolders and all files first before deleting the actual folder?. Thats why. Its a filesystem level limitation to my knowledge, since alot of stuff needs to happen to delete a folder before it can be deleted (checking permissions, checking if any files are not in use, etc.). So that's the reason why you are cant delete folders directly. As for why you are getting Access Denied when you are deleting a folder, idk why, its the error code Windows uses when you do that.
use b-trees they are used for actual databases to keep memory usage and performance reasonable I recommend that you take a look at a book called "database internals" the second , the third and the forth chapter will help you a lot in understanding b-trees and how to store data on disk efficiently its not a long read don't worry EDIT: consider fetching sibling nodes to access similar filenames to what you searched for
@kuhluhOG
10 ай бұрын
he went the manager route: delegating it
Is HashCashMap some kind of asian dish or something?
@Floky
11 ай бұрын
Sounds more like a drug tbh XD
Keep up the good work mate!
bro tried to compare two objects and blamed Javascript 💀
@cfuendev
11 ай бұрын
It's a canon event. All JS devs have to go through this
I think instead of saving cache to disk every 30 seconds it would make more sense to save when you exit and maybe also after the program reaches a certain memory threshold
@lythd
11 ай бұрын
i guess just the worry of crashing, so probably exit and every 30 seconds?
@hostgrady
11 ай бұрын
@@lythd my main concern is the disk writes. I think there's a balance between getting accurate results and not destroying things like your disk and your memory. Thats why I think it's easier to simply calculate what's changed since you last left in the background and write that and from there just scan in the background for changes and add those into memory. Though to be fair I am not a programmer so idk how reasonable this is
@lythd
11 ай бұрын
@@hostgrady that just sounds like redoing the cache, that would take too long.
@hostgrady
11 ай бұрын
@@lythd counter point: his caching system sucks
@lythd
11 ай бұрын
@@hostgrady possibly i wouldnt know i havent seen it. i just think rn itll be fine once he adds the save before exit.
Keep going for the love of all things holy
Do you do this on live or twitch?
ok but where is the button to easilly open a terminal window in that same folder? that would be a neat addition ( i could write it my self but i don't know any rust lol )
I saw you were using tauri for the app framework. Was there an issue with using surreal as the cache?
pretty cool, i like rust its cool! nice project i downloaded it, UI sucks tbh but pretty fast
4:00, is there no operator overloading?
Are you parsing the MFT or scanning the file system directly?
I think you can abuse the Master File Table?
A search in file would be nice too
I wonder if you can make it even faster xd
I knew that I was watching a worthy channel as soon as I saw an A320 checklist and Little Navmap.
I see some flightsim enyojer here (a320 checkilst and little navmap)
Could cache save the modification timestamp of the file/folder so it bacomes easy to validate and update cache during search?
@DaddyFrosty
10 ай бұрын
Interesting idea but there could be a lot of flaws, running a service in the background is probs the easiest solution to avoid cache issues.
@edwolt
10 ай бұрын
@@DaddyFrosty Wich kind of flaw could exist?
When You Try Something For First Time 😂
4:05 It's even more fine to hate chatGPT... because that's where you got your code from.
I got to be in the video nice!
try to replace js with wasm rust, for example, yew (is very similar to react)
noti gang
Ah rust a fast safe language where the safe code isn't fast and the fast code isn't safe.
Can you make a tutorial where you explain how to create a file explorer?
We love objects!
ggs
Every single programmer in the entire world be like 1:28 💀
how to run?
I dont recommend chatgpt for rust (sadly), what chatgpt knows is too outdated
@faeancestor
11 ай бұрын
how should I code in rust then
@Omikronik
11 ай бұрын
@faeancestor normally, with the docs and stackoverflow. Its still kinda helpful to get more info on errors you dont understand with chatgpt though. Just dont expect up to date code and library use.
Whats the song at the very end?
@chris-xp9bc
11 ай бұрын
kzread.info/dash/bejne/X5eolaSHc9ffj8o.html
@skorp5677
11 ай бұрын
+1 interested too
@conaticus
11 ай бұрын
Here's a link: www.epidemicsound.com/track/504P66ZgB8/
@skorp5677
11 ай бұрын
@@conaticus Thanks!
gaming
Try storing the cache in an sqlite database. Before you store it though, compress it. Storing that much in a json file is just a terrible idea🤣
When part 3?
Great video!
Suggestion: add tabs
Use voidtool everything
My advice with any task. Do it the super dumb way until you need to add complexity.
crab🦀
"Coding better file explorer than Windows" ok then. Aim high.
@faeancestor
11 ай бұрын
what
@conaticus
11 ай бұрын
at least mine doesn't have ads in it 😂
When next video about this
Now do it in C!
-This guy is officially a chad-
nah bruh what you done now 💀
I was gonna say all the mistakes in this video but youtube said the comment was too long
I made it in python and its instant
Can you make it open source?
It is going to use more RAM than Chrome
average experience of programming
successfully ruining a program my favorite
lol
uhhh
We have a better file explorer, it's called ls
plz stop T-T
just use c++, not some fake languages like rust or ts
and during all this, "voidtools everything" is just out there searching terabytes as-you-type