0

I am trying to create a directory for a movie on my Plex media server and ran into a strange issue. When I try to make a directory with the movie name ("Borat: Cultural Learnings of America for Make Benefit Glorious Nation of Kazakhstan"), I get the following error:

pi@raspberrypi:/media/pi/Plex/Movies $ mkdir "Borat: Cultural Learnings of America for Make Benefit Glorious Nation of Kazakhstan"
mkdir: cannot create directory ‘Borat: Cultural Learnings of America for Make Benefit Glorious Nation of Kazakhstan’: Invalid argument

I know that colon (:) is a special character, and this command works without the colon. What I cannot explain is why the command works with the colon if I run it in different paths. For example, it worked in:

  1. /media/pi
  2. /home/pi
  3. /tmp

I thought it might be because of a path length limit, but that was not the case. Any other ideas why this is happening?

4
  • 2
    What type of filesystem is the /media/pi/Plex/Movies directory mounted on?
    – Kusalananda
    Commented Oct 17, 2022 at 6:43
  • 2
    : marks NTFS alternate data streams, hence isn't valid in file names there, so it's conceivable it would fail on NTFS. Commented Oct 17, 2022 at 6:56
  • @Kusalananda I completely forgot that /media/pi/plex is external storage, using exFAT... I assume exFAT is like NTFS when it comes to colons.
    – Saar Koren
    Commented Oct 17, 2022 at 7:27
  • NTFS doesn't prevent me creating items with colons - in Cygwin on Windows (with NTFS) I can mkdir 'a:b' and it happily creates the directory for me. (In Windows Explorer, however, the same directory is represented as a·b.) Commented Oct 17, 2022 at 8:02

0

You must log in to answer this question.

Browse other questions tagged .