Why does ROX filer ignore /usr/share/mime/globs? (Solved)

Using applications, configuring, problems
Post Reply
Message
Author
LateAdopter
Posts: 361
Joined: Fri 27 May 2011, 17:21
Location: Reading UK

Why does ROX filer ignore /usr/share/mime/globs? (Solved)

#1 Post by LateAdopter »

ROX filer in xenialpup64 and fatdog710, do not show valid MimeTypes for my .ts recordings and for my .m3u playlists.

The ROX documentation says:
How does the filer decide what icon to show for a file, and which program to use to open it?

For each file, the filer starts by working out its MIME-Type, as follows:

If the file's user.mime_type extended attribute it set, then that is its MIME type.

If the file's name matches a pattern in one of the globs file (usually, /usr/share/mime/globs) then the line in that file gives the type.

If the contents of the file match a pattern in one of the magic files (usually, /usr/share/mime/magic) then that gives the type.

Otherwise, it is text/plain (looks like text), application/x-executable (marked as executable) or application/x-octet-stream (doesn't look like UTF-8 text).

Do not edit the globs and magic files directly, as they are generated from some XML files by the update-mime-database command. If the filer isn't getting the right type for a file, you can use MIME-Editor to change the rules.
The playlist files are identified as plain text even though *.m3u is a defined glob. If I add #EXTM3U at the start of the file they are recognised as audio.

The transport stream files recorded by tvheadend or my satellite receiver are identified as executables even though *.ts is a defined glob. The ones I have edited are identified as video.mp2t which is correct.

So it seems that ROX filer and gnome-mpv may be using the magic numbers but not the globs. But the Gnome developers guide says that globs are preferred.

The files are on a FAT32 drive so they can't have extended attributes.

I presume there is some underlying linux function that ROX and gnome-mpv are using that is not configured correctly.
The files in /usr/share/mime all look sensible.

Does anyone have any idea what might be wrong?
It's not possible to set a run action when the MimeType is incorrect.

Thanks

LateAdopter
Posts: 361
Joined: Fri 27 May 2011, 17:21
Location: Reading UK

#2 Post by LateAdopter »

Having installed the GnomeVFS packages, files are now recognised by extension as well as magic number.
Since there may be several types of file with the same extension, it may not guess correctly. I had to edit /usr/share/mime/packages/freedesktop.org.xml to get it to identify .ts as video/mp2t
Also the way other files are identifed may change and break xenialpup64's file associations, which will need to be redefined.

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#3 Post by bigpup »

Wonder if this would be an issue, if you had the files on a Linux formatted partition, which would be a Linux file system :idea:
Fat32 format is a Windows file system.
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

LateAdopter
Posts: 361
Joined: Fri 27 May 2011, 17:21
Location: Reading UK

#4 Post by LateAdopter »

Hello bigpup

I think the extended attribute mechanism would only work if:... the file were written by a unix program that did set the extended attributes on a unix filesystem and then read by a unix program.

My TV media player accepts FAT32 or exFAT, my satellite receiver does FAT32 or NTFS.

Most linux programs are cross platform targeted at Windows and OSX.

For this problem the bugs/blame lie with Gnome/GTK+/XDG:
GnomeVFS was deprecated in favour of GVfs about nine years ago.
I tried installing GVfs but that did not fix it with either ROX or gnome-mpv.

ROX does not identify GnomeVFS as a dependency, but ROX seems to be largely unmaintained for about six years, so maybe GnomeVFS was a base package then.

I am now using gnome-mpv 0.12.0, from buster, which is current and does have a "show all files" option. But the latest build for Xenial is 0.10.0 which does not have "show-all-files" so I could only play by drag and drop or from the command line.

When tvheadend put up the packages for 4.2.x stable branch I will install it and see whether it would write extended attributes for a transport stream recording. I don't want to fiddle with my working copy of 4.1.

There is still a basic defect of the shared-mime-info system: It does not check that the contents of the file match the guessed MimeType. With the system working it guessed .ts was a trolltech text file and wanted to open it with the default text editor, But the linux file command already knows that the contents of transport stream is data not text. I had to delete the trolltech entry in the .xml file to get a sensible answer.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#5 Post by disciple »

LateAdopter wrote:Most linux programs are cross platform targeted at Windows and OSX.
Certainly not!
Maybe the big, really well known ones i.e. Libreoffice, VLC, Firefox... but they might only be more well known if you are considering the non-linux using population :)
ROX does not identify GnomeVFS as a dependency, but ROX seems to be largely unmaintained for about six years, so maybe GnomeVFS was a base package then.
I've never noticed any problems like this, although most of my experience is with quite old puppies (which weren't built from other distro's packages). I'd be interested to know if your problems are specific to xenialpup (which I have never used)... have you used any others
Last edited by disciple on Wed 27 Sep 2017, 18:48, edited 1 time in total.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

LateAdopter
Posts: 361
Joined: Fri 27 May 2011, 17:21
Location: Reading UK

#6 Post by LateAdopter »

disciple wrote:I've never noticed any problems like this, although most of my experience is with quite old puppies (which weren't built from other distro's packages). I'd be interested to know if your problems are specific to xenialpup (which I have never used)... have you used any others?
Hello disciple

Since you ask I just checked:...
Fatdog 710 has the same problem as Xenialpup64.

Pemasu's Precise372 the globs work and it does have GnomeVFS already installed. Also it does identify .ts as trolltech linguist too.

I no longer have Lucid Puppy 5.2.8 bootable immediately. Sorry Playdayz.

LateAdopter
Posts: 361
Joined: Fri 27 May 2011, 17:21
Location: Reading UK

#7 Post by LateAdopter »

bigpup wrote:Wonder if this would be an issue, if you had the files on a Linux formatted partition, which would be a Linux file system :idea:
Fat32 format is a Windows file system.
Hello bigpup
I installed tvheadend 4.2.3 from Launchpad on my Xenialpup64 remaster. I had to use the package for Zesty because my ffmpeg was too new for the one built for Xenial.
I set it to record to a unix filesystem but the resulting file did not have any extended attributes. It was identified as octet stream data on standard Xenialpup64 707 or 7085, but as video/mp2t Transport stream with GnomeVFS installed. The same as my other recordings.

Post Reply