LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (http://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Is there a way to hide file types? (http://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


All times are GMT -5. The time now is 11:15 PM.