LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Is there a way to hide file types? (https://www.linuxquestions.org/questions/linux-desktop-74/is-there-a-way-to-hide-file-types-551167/)

davidguygc 05-04-2007 12:10 AM

Is there a way to hide file types?
 
Hi, I have a dual boot between vista and slack11. I am sharing My music with windows, and as such it puts hundreds of album artworks in the folder. It isn't seen in windows, but it sure is in konqueror. I know that I can filter the jpegs once, but once I close the window and go back to it they are back.

Is there a program or a way around this annoyance?

deadeyes 05-04-2007 01:11 AM

Quote:

Originally Posted by davidguygc
Hi, I have a dual boot between vista and slack11. I am sharing My music with windows, and as such it puts hundreds of album artworks in the folder. It isn't seen in windows, but it sure is in konqueror. I know that I can filter the jpegs once, but once I close the window and go back to it they are back.

Is there a program or a way around this annoyance?

I don't think that is possible because linux does not uses file extensions like windows does.

Please someone correct if I am wrong

archtoad6 05-04-2007 12:01 PM

A better Q would how can I show filetypes in Winders (tm:))?

The fact that M$ allows you to hide them is actually a security flaw because it allows the .ext of malicious files to be hidden.

Be thankful you can't do this in Linux.

Quakeboy02 05-04-2007 12:17 PM

Quote:

The fact that M$ allows you to hide them is actually a security flaw because it allows the .ext of malicious files to be hidden.
I agree with archtoad6. In every Windows I've used I've always turned that "feature" off.

davidguygc 05-04-2007 04:33 PM

Well, I don't want to see these files either in Windows. iTunes put all these files in the same directory then makes them hidden. I still want these files, just not see them lol. I'm really suprised that you can't save in the folder settings filter settings per folder.

AdaHacker 05-04-2007 11:09 PM

You could try a .hidden file. I don't know about Slackware, but it works in Kubuntu.

You just create a text file named ".hidden" in the directory and list the file and directory names you don't want to see, one per line. This will make Konqueror treat those as hidden files. You could create this file automatically login with a simple script like this:
Code:

#!/bin/sh
cd /path/to/your/music
ls *.jpg > .hidden


rickh 05-04-2007 11:12 PM

Maybe you could just put the files in a "hidden" folder.

davidguygc 05-04-2007 11:39 PM

I thought that, but then I don't think that itunes could then see it. Guess I'm just SOL

archtoad6 05-05-2007 08:50 AM

Oops, I just re-read the OP & it seems it's the entire file that's hidden, not just the extension. Apologies for the previous off problem post.

We are up against a different, more interesting problem here: Harmonizing the differences in the ways the 2 OS's mark hidden files.

I am sure everyone here doesn't need the following review, but it might be useful to others reading this later:
File hiding is done differently in the 2 OS's. M$ file systems have a "hidden" attribute, similar to *nix file systems permission bits. Unices, including Linux, treat any file name, including directories, that begins w/ '.' as hidden.

If the .hidden file trick would work when cross-platform browsing, that would be great, but in my test it didn't. On my girlfriend's W2k box I did:
Code:

dir /b /ah > .hidden
in her Documents and Settings directory. The code worked exactly as intended -- .hidden contains a list of all hidden files. Unfortunately, Konqueror did not honor its contents, but did honor the leading '.' in its name. Note, I was using the "smb://" kioslave in Konqueror to do this browsing. This technique doesn't work any better using smb2k, which displays the shares to Konqueror in a subdirectory of an "smb2k" directory in "~" ($home).

Finally, I decided to see if this is a Kubuntu thing & checked it on 2 Linux boxen: SimplyMEPIS 3.3.2, KDE 3.3.2 & SimplyMEPIS 6.0, KDE 3.5.3 -- it didn't work on either. (With apologies to those who know this, MEPIS 6.0 uses the K/ubuntu repositories, 3.3.2 does not.)

AdaHacker,
  • Which Kubuntu?
  • Which KDE?
  • In all 4 cases above I think I did exactly what you suggested:
    Quote:

    You just create a text file named ".hidden" in the directory and list the file and directory names you don't want to see, one per line.
    Especially the "1/line" part. I did check the contents of the .hidden files, I did start new instances of Konqueror, I did not restart X or re-boot.

  • Have you ever used this technique cross-platform?

davidguygc,
  • How are you browsing the M$ file system from Linux?
  • Which ver. of KDE/Konqueror are you using?

davidguygc 05-05-2007 09:43 AM

I have these files in a vfat partition mounted under /mnt/MyDoc the files are under "/mnt/MyDoc/My Music"

If this .hidden file idea works, will it work w/ regular expressions? All of these are jpegs, and there are too many to list individually, and I can only assume that a lot are being added/taken away whenever I change anything in my music library

I am using KDE 3.5.4

AdaHacker 05-05-2007 07:31 PM

Quote:

Originally Posted by archtoad6
Which Kubuntu?

I know it works on Feisty and Edgy. It's what they use to hide the system directories under /.
Quote:

Which KDE?
Whichever ones shipped with Kubuntu Edgy and Feisty. ;) Feisty, at least, uses version 3.5.6.
Quote:

In all 4 cases above I think I did exactly what you suggested: Especially the "1/line" part. I did check the contents of the .hidden files, I did start new instances of Konqueror, I did not restart X or re-boot.
No need to restart X. KDE should pick up the changes as soon as the file is saved. The only caveat is that each line has to be the exact file/directory name - even an extra space at the end will throw it off.
Quote:

Have you ever used this technique cross-platform?
Nope. I've only ever seen this on Kubuntu. It could be that this feature was added by the Kubuntu team and isn't part of KDE proper. I don't know and Google failed me on that. I just thought I'd mention the possibility.

AdaHacker 05-05-2007 07:33 PM

Quote:

Originally Posted by davidguygc
If this .hidden file idea works, will it work w/ regular expressions?

No, it doesn't. No regular expressions, no wildcards. Only exact file names. That's why I suggested building the file on login.

davidguygc 05-05-2007 08:34 PM

I don't know if I could make a program that could do that in Linux. I probably can for Windows, but I really haven't made any programs in C++ on Linux yet, so I am not familiar with the functions.

archtoad6 05-06-2007 12:04 PM

davidguygc, Why the mention of C++? Did I miss something? What's wrong w/ using command line tools, i.e. shell script, batch, .cmd? There is Linux code in post #6, & DOS/Win code in post 9. If the file is created automatically, who cares how big it is? I doubt it's going to fill a partition meant for music. In fact it's going to be a tiny fraction of the size of just the image files it lists, let alone the music files they accompany.

AdaHacker, What about Dapper, do you know one way or the other if this works in Dapper? SimplyMEPIS 6.0 uses the K/Ubuntu 6.06 LTS repositories, if this functionality was added after that, regardless of by whom, then that would explain why it doesn't work for me. OTOH, if it works in Dapper, that would indicate that Ubuntu added this and MEPIS didn't pick it up.

davidguygc, If .hidden works in KDE 3.5.6, but not 3.5.3, & you have 3.5.4, why not just try it & see what happens? The worst case is that we all learn something.

davidguygc 05-06-2007 12:09 PM

I only know C++, I don't know how to do anything with shell script other than single line commands, and my system has been down for a couple of days, so I've been unable to try anything out. That's one of the first things I'm gonna do as soon as I get it up and running

hacker supreme 05-06-2007 01:26 PM

I know the reason Windows hides them.
It names them: AlbumArt_{C544350D-AF2A-4173-8948-9AB913E1957E}_Large.jpg
This code (enclosed in squiggly brackets.)means something special to windows and different files for different things have different codes. Windows hides (permanently. As in you can't unhide them, AFAIK) these files.

However, in *nix, these codes mean precisely naff all, and it treats them like an ordinary jpeg. Which is why it shows them but windows doesn't.

You could hide them in *nix by renaming them ".<original_filename>" but I'm not sure if the application that put them there will be able to use them as it intended.

AdaHacker 05-06-2007 08:16 PM

Quote:

Originally Posted by archtoad6
davidguygc
AdaHacker, What about Dapper, do you know one way or the other if this works in Dapper?

I don't have a VM with Dapper handy, so I can't say for sure. However, the Kubuntu FAQ seems to say that the hidden system directories started with Edgy, which sounds right to me. So I'd guess the answer is no.

davidguygc 05-07-2007 12:16 AM

Quote:

Originally Posted by hacker supreme
I know the reason Windows hides them.
It names them: AlbumArt_{C544350D-AF2A-4173-8948-9AB913E1957E}_Large.jpg
This code (enclosed in squiggly brackets.)means something special to windows and different files for different things have different codes. Windows hides (permanently. As in you can't unhide them, AFAIK) these files.

However, in *nix, these codes mean precisely naff all, and it treats them like an ordinary jpeg. Which is why it shows them but windows doesn't.

You could hide them in *nix by renaming them ".<original_filename>" but I'm not sure if the application that put them there will be able to use them as it intended.

Yes, that is my exact problem in a nutshell. You can show them in Windows, you have to set an option to view hidden files/folders.

I'm thinking that there must be some sort of way to call konqueror from the command line to where it has already preloaded the filter. I would like to think that is the best approach, if it exists.

archtoad6 05-07-2007 09:09 AM

hacker supreme, thanks for the info. on M$.

AdaHacker, I'm still looking for some official documentation on this .hidden file. Google seems worthless, probably because they ignore the '.'. Did I not follow your link deep enough?


davidguygc, Maybe it's time to start playing w/ the CLI (Command Line Interface) ;).

If the .hidden file technique works in your ver. of KDE, there is no need to think "filter" or calling Konqueror from the command line. The .hidden file is the filter & Konqueror should be started normally.

AdaHacker 05-07-2007 03:52 PM

Quote:

Originally Posted by archtoad6
AdaHacker, I'm still looking for some official documentation on this .hidden file. Google seems worthless, probably because they ignore the '.'

Yes, that's the downfall of Google: it's impossible to search for a literal string (at least as far as I know).

I haven't found any official documentation on it either. In fact, pretty much all I've found is a page on the Ubuntu wiki with instructions to delete /.hidden to make the system directories visible again. The rest I had to figure out for myself. At this point, I think it's most likely an Ubuntu-specific thing, as I've not seen it come up with relation to any other distribution.

archtoad6 05-08-2007 05:21 PM

AdaHacker, Is this what you meant your link in post 17 to point to?
Quote:

How can I see all the folders in the root directory?

The non-user folders in / are hidden by default in 6.10 (Edgy). To show them use View -> Show Hidden Files in Konqueror. To stop them being hidden go to /etc/kubuntu-default-settings/ in Konqueror and Right Click on hidden-root -> Edit As Root and empty the file.

This feature has been removed in Feisty.
I see no mention of .hidden .

AdaHacker 05-08-2007 07:56 PM

Quote:

Originally Posted by archtoad6
AdaHacker, Is this what you meant your link in post 17 to point to?

I see no mention of .hidden .

Yes. The /.hidden file is the means by which those directories were hidden.


All times are GMT -5. The time now is 06:34 AM.