Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Strange behaviour with colons in folder names

  1. #1

    Default Strange behaviour with colons in folder names

    I have recently upgraded from 13.2, where all partitions were ext4 to Leap 42.2, where the root partition is Btrfs and /home is XFS as recommended. I have a networked LibreELEC/KODI media server with an ext4 file system. This has over 1000 folders and filenames incorporating a colon character. When I mount the media server from the openSUSE computer and use Dolphin in Super User mode, I can see all the folders correctly on the media server. However, where the folder name has a colon character in it, Dolphin displays no files in that folder. Where there is no colon character in the folder name, the files are all visible.

    This behaviour has repercussions for the file tags. Puddletag can no longer see any tags for files in these folders. The system worked perfectly in openSUSE 13.2 and as far as I know, the colon is an acceptable character in Linux filesystems. Extensive searches on this problem have failed to reveal the cause and I am completely baffled. I would be very grateful if anyone knows of a solution.

  2. #2
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,374
    Blog Entries
    3

    Default Re: Strange behaviour with colons in folder names

    How does your media server work?

    If it is using a Windows protocol (such as Samba), the ":" is an illegal character for Windows file systems.

    It can also be a problem with "NFS", because people often use "servername: path". But you can usually work around that.
    openSUSE Leap 15.1; KDE Plasma 5;

  3. #3

    Default Re: Strange behaviour with colons in folder names

    Quote Originally Posted by nrickert View Post
    How does your media server work?

    If it is using a Windows protocol (such as Samba), the ":" is an illegal character for Windows file systems.

    It can also be a problem with "NFS", because people often use "servername: path". But you can usually work around that.
    Thanks for replying so promptly, nrickert. Funny - I woke up this morning thinking I'm using a CIFS mount and maybe this could be the issue.

    LibreELEC is described as "just enough OS Linux software appliance distro for Kodi." Effectively LibreELEC has Kodi running as its only application but Samba has been implemented for several reasons, not just file sharing, hence mounting via CIFS. This used to work perfectly in openSUSE 13.2 but does not in Leap 42.2. I can only think that something has changed to prevent the colon being used since, as you say, it is an illegal character in Windows. Maybe it's a newer version of Samba.

    It looks as though my only options are to replace all the colons in the file and folder names or to implement an NFS server in LibreELEC, unless there is some way to get around the prohibition of this character.

  4. #4

    Default Re: Strange behaviour with colons in folder names

    Quote Originally Posted by docrob View Post
    It looks as though my only options are to replace all the colons in the file and folder names or to implement an NFS server in LibreELEC, unless there is some way to get around the prohibition of this character.
    I thought I might have found a simple way round this problem by using the mount option mapchars but it had no effect. I don't know why, but it looks as though my options remain as above.

  5. #5
    Join Date
    Aug 2010
    Location
    Chicago suburbs
    Posts
    12,374
    Blog Entries
    3

    Default Re: Strange behaviour with colons in folder names

    Quote Originally Posted by docrob View Post
    I thought I might have found a simple way round this problem by using the mount option mapchars but it had no effect. I don't know why, but it looks as though my options remain as above.
    If it is any use, here is my script for removing colons from file names.

    Code:
    #! /bin/sh -
    ## $Id: $
    
    ### DECOLONIZE - remove colons from file name
    # -d (default) delete the colon (or other) character
    # -s x  replace colon (or other) with substitute x.
    # -c y  the character to replace (defaults to ':')
    
    USAGE="decolonize [-d -s x -c y ] file"
    
    # defaults
    chartochange=':'
    replacement=''
    
    while getopts dc:s: op
    do
      case "$op" in
       d)   replacement='' ;;
       c)   chartochange="$OPTARG" ;;
       s)   replacement="$OPTARG" ;;
       *)   echo "$USAGE" >&2
            exit 1 ;;
      esac
    done
    
    shift `expr $OPTIND - 1 || :`   ## sigh! expr gives status 1 if answer=0
    
    ### sanity check.  Should check that "$chartochange" is of length 1 and
    ### "$replacement" is of length 0 or 1
    ### add check later
    
    ## rename one file
    
            renamefile() {
                    file=`echo "/$1" | sed -e 's=.*/\([^/]*\)$=\1='`
                    if [ "$1" = "$file" ] ; then
                            path=""
                    else
                            path=`echo "$1" | sed 's=\(.*/\)[^/]*$=\1='`
                    fi
    
                    if [ "$replacement" = "" ] ; then
                            newfile=`echo "$file" | tr -d "$chartochange"`
                    else
                            newfile=`echo "$file" | tr "$chartochange" "$replacement"`
                    fi
    
                    if [ "$newfile" != "$file" ] ; then
                            mv "$path$file" "$path$newfile"
                    fi
    
            }
    
    for f in "$@"
    do
            renamefile "$f"
    done
    openSUSE Leap 15.1; KDE Plasma 5;

  6. #6
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,954
    Blog Entries
    2

    Default Re: Strange behaviour with colons in folder names

    You can also try enclosing any text strings within quotes, that instructs the machine to not interpret any special characters including colons as text and not as an operator.

    In other words, modify the commands you use... not every label.
    But, in the long run of course avoiding the possibility in the first place will mean fewer possible problems.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  7. #7

    Default Re: Strange behaviour with colons in folder names

    I'm not sure why but I had some problems using a minus sign in file names. It was a long time ago and became apparent when I searched for files to move to a back up before an upgrade. Now i stick to underscore but prefer to make use of capitalisation. After all keyboards do have a shift key.

    John
    -
    Leap 42.2 KDE 5.26
    3.6gig Xeon, 64bit SATA Raid home - Linux Raid 1
    All software on a flash drive, SATA swap & Temp files,

  8. #8

    Default Re: Strange behaviour with colons in folder names

    Thanks for all your replies.

    rnickert - thank you for your script, which looks very handy and I may end up having to use something like this. I will exhaust other possibilities first, because the colon is useful and logical in the file naming and tagging and the thought of having to change to another character in over 1000 files is rather daunting.

    tsu - unfortunately I don't think this is a solution as the current setup uses puddletag to edit the tags in the music library. With this colon problem, not only do files within directories with a colon in their names not appear in the file manager, but the puddletag window is completely blank.

    ajohnw - I have not (yet) seen a problem with any other character. Obviously, there are characters which are legitimate in Linux but not allowed in Windows file systems, the colon being one. Since both the media centre computer and the computer through which access is obtained to the media centre run Linux, there is no intrinsic problem here. The issue is that the generic release of LibreELEC has only a Samba server, hence restricting the mount method to CIFS.

    One solution mentioned was to install an NFS server in LibreELEC, which does have the drawback that the system is no longer generic, so would need attention every time there was a version change. Another idea which has just occurred to me is that it may be possible to install a tag editor in LibreELEC, thereby obviating the need to use a second computer for access. These two possibilities strictly take me outside the remit of this thread, which was to establish the cause of the colon problem and why it had suddenly manifested itself in the change from OpenSUSE 13.2 to Leap 42.2. This is now sufficiently clear, thanks to your replies and while the problem is not yet actually solved, I think I need to turn my attention to LibreELEC rather than OpenSUSE.

    If I manage to achieve a satisfactory result I will report back, in case the information is useful to others.

    Thanks again to all.

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    10,954
    Blog Entries
    2

    Default Re: Strange behaviour with colons in folder names

    If you're using a specific client software like puddletag,
    Then you should submit a bug report to that project...
    I'm sure that they would want to know about the problem because it's more than just an inconvenience, it's a potential security flaw. possibly exploitable.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #10

    Default Re: Strange behaviour with colons in folder names

    I may be wrong, but I don't think it is a problem with puddletag. My file browser can no longer "see" the files in folders with a colon in the folder name. I used a simple CIFS mount with OpenSUSE 13.2 and its predecessors and it worked fine. The problem has occurred with the upgrade to Leap 42.2. I suppose I should not really be surprised if Samba does not now allow characters illegal in Windows file systems. The bigger surprise is perhaps that it once did.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •