All about open source! Feel free to ask questions, and share news, and interesting stuff!
Useful Links
Rules
- Posts must be relevant to the open source ideology
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon from opensource.org, but we are not affiliated with them.
- 0 users online
- 1 user / day
- 8 users / week
- 33 users / month
- 215 users / 6 months
- 17 subscribers
- 1.6K Posts
- 5.44K Comments
- Modlog
Where does the file go if it is named with a.txt?
This technique is usually used with checksums because they have a predefined length and alphabetic characters can be safely casted to lower case. How do you want to differentiate between upper case and lower case here asauming that you are using a file system that is sensitive to it?
deleted by creator
See, you have an x/y-problem here. You’re trying to solve a problem by creating a solution which might lead to other problems.
Do you have those files on an SSD? Is it just one folder you open regularly? Maybe you can cache the folder structure at the beginning of your session? You could just run
ls /path/to/folder
when you start your desktop environment, if you’re on Linux. That puts the file list into the file system cache. Similar things can be done withdir
on Windows.With the
dir_index
mount option, you can also speed up directory indices a lot if you run Linux and regularly handle huge folders.You can also move the folder to a faster disk, e.g. an NVMe drive. PCIe-attached NVMe drives have such a high speed that it’s faster than some versions of RAM. DDR2-400 RAM for example has a speed of 3200MiB/s, whereas the SK Hynix P41 SSD has a read speed of about 7000MiB/s.
a simple script will do the job. do you know any programming?
Are you sure about that? ;)
Usually, it’s the edge cases that kill something like this. For example, you can have a loop over a list of files which just looks at the first letter and sorts that into folders. However, you’d have to watch out for irregularities in encoding of filenames, upper-/lowercase, the filenames themselves having spaces at the beginning etc.
a generic alphabetic sort library should do the job. might even have it in the standard library of your lang.
but yea, i get your point. if you make a small script and don’t take meticulous care, even if you’re a professional programmer, that script will eventually break on some edge case, and the effort required to prevent that outweighs the benefit of the script. been there too many times, and i scrap most of this stuff because of it. or find some unintuitive manual solution to it.
Exactly. Not to say it’s exactly that in this case, but you never know the real solution until you started to solve it. ‘I’ll just write a script’ has been famous last words of many work units for me, I have a huge repository of nearly working scripts which all broke on some edge case.
removed by mod