Good evening.

I am writing a project, it just so happens that you often need to rename file names. I note: rename without moving. And it suddenly became interesting, but is it very time consuming? After all, if so ... you have to redo the logic of the project quite differently.

  • 2
    It depends on what you mean by "laborious". If the work with files is very massive - it is better to store them in hard form as id.ext, in the database, keep the id, ext, title fields and change the title directly (again, this is only if the file handling is massive) - Zowie
  • and I do) thanks) - Denis Masster

3 answers 3

Any work with the file system is resource-intensive, so it is better to avoid it, I recommend following the advice of @Intuo

PS it does not depend on the programming language.

  • The disk subsystem has a relatively small bandwidth, and its increase is very expensive. - razielsd

Save in the database new names and pointers to the files being renamed, and it is better to store the files on another server or hard disk, then give users access to them through these names stored in the database (something like aliases).

    Well, if you rename the file is part of the algorithm, then why not. No, it is not time consuming.

    • understood, thanks - Denis Masster