0

In the system I developed for the company where I work we have a kind of file drive. However, an old rule that I put is the prohibition of / and ' in the name of folders and files because of the rules of naming folders and files in Linux.

However I wanted to remove this rule, it would simplify the uploading and naming of folders and files. The most correct way would be for me to immediately migrate to S3 (rs) but for now I don't have time for that, does anyone know any way I can get around this situation?

  • `'` is perfectly valid in file names. `/` on the other hand is interpreted as the directory separator, so it can be part of a path, but not a name. – choroba Oct 04 '22 at 20:22

1 Answers1

1

On POSIX systems including Linux, the file name cannot contain null or /. They delimit strings and path name components, respectively.

In this not very strict limitation on "characters" there are user experience problems. Various punctuation and control characters can cause confusion, for example new lines or shell control characters. But the file system can store most strings of bytes as names. See also on UNIX.SE: Is it correct to use certain special characters when naming filenames in Linux?

If you must allow arbitrary characters in a descriptor, including /, file name is no longer adequate. Use an application that can store this metadata, either in the file, or in some database.

John Mahowald
  • 32,050
  • 2
  • 19
  • 34