[long-term] ReactOS explorer file identification

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

mf
Developer
Posts: 368
Joined: Mon Dec 27, 2004 2:37 pm
Location: Eindhoven, NL
Contact:

[long-term] ReactOS explorer file identification

Post by mf » Sat Feb 05, 2005 8:03 pm

Okay. Here's an idea.
We all know how DOS-based systems use a 3-character identifier (with the advent of Windows 95 extended to any length within pathname limits) at the end of a filename (prefixed with a period), to identify file type. We all know MacOS uses its filesystem to store this information seperately (in the resource fork). We all know UNIX systems don't really care.

Now we are here trying to build an operating system centered on the Windows design, but leaning towards compatibility with other systems (through subsystems and non-picky application/filesystem compatibilities). How are we going to solve the filetype mess. Force people to rename their files with extensions? Nah. Forcing is a strategy used by a certain Redmond-based company. We don't like that.

My suggestion:

UNIX has a nice little tool, called "file". Brilliantly vague in its descriptive name, it probes a file in a number of ways and determines its filetype mainly through content, and if unknown, reports what kind of file it is, anyway (ASCII or binary, what character encoding, etc). It is though, rather slow and not really suited to "include" in an application.
So here we have, FileType, which does the same, in a more elegant and extendable way, and it's supposed to be included into the source of applications. Yay!

So. The "form" of getting it to work. If a file contains a classic extension, in the list of known filetypes as the windows (and soon ReactOS) registry provides, it is classified as being what it says it is. If it however does not contain an extension (no period in the filename) or it is not in the list of known extensions, it is probed (and ONLY if it is not recognized, because we should not probe known files on every directory listing, to save speed), and if the filetype is associated with a classic extension, included in the listing as:
"Filename <.ext>"
If the filetype only has a descriptive name, and not a known classic extension, it is included in the listing as:
"Filename <filetype>"
The reason I pick < and >, is because these are illegal characters as a filename. They are commandline control characters (command > file pipes the output (stdout) of "command" into "file"), and will never occur (never say never, but I don't really expect something like that to happen without the filesystem driver b0rking in one way or another) in a filename. This way you can clearly see it's something Explorer added, and not part of the filename. I'd suggest the commandline "dir" command would follow the same behavior.

So, for example, let's assume ReactOS has implemented the abovementioned idea, and has a working Linux subsystem, fully integrated. A user extracts a linux .tar.gz file, and the contents are a helpfile and an executable. The user opens the directory in ReactOS Explorer and sees:
README <.txt>
someapp <.elf>
He doubleclicks the someapp icon, and someapp launches. Yay for seamless integration!

Thoughts?

Phalanx
Posts: 360
Joined: Sun Dec 19, 2004 12:42 am
Location: Australia

Post by Phalanx » Sun Feb 06, 2005 12:21 am

that sounds like virus hell to me! I really do not like it at all. Files with no extension are there for a reason. A file with an unknown extension is there for a reason. I also use the renaming of file extensions a lot, it is very, very useful.

This would also really slow down the computer (esp. when browsing), and place a lot of wear on your hard disk, which is one thing that fails easily and yet one thing you really do not want to loose. So, in this way i do not like this idea at all.

However, there is one use of this idea I would find useful. I would like the ability to open the same file extension in two different programs depending on what type they are. For example, avi files. If the file has the DV-AVI codec, I would like it opened in WMP, else if it has the DivX or XVid codec I would like it opened in VLC. Currently I just use open with, but this is less of a hard disk killer, do not have problems with potential viruses and still allows you to change the file extension which is useful.

And XP allows you to hide the file extension if the user wishes anyway,

mf
Developer
Posts: 368
Joined: Mon Dec 27, 2004 2:37 pm
Location: Eindhoven, NL
Contact:

Post by mf » Sun Feb 06, 2005 12:38 am

Phalanx wrote:that sounds like virus hell to me! I really do not like it at all. Files with no extension are there for a reason. A file with an unknown extension is there for a reason. I also use the renaming of file extensions a lot, it is very, very useful.
Who said you can't rename file extensions? If a file has a known extension, it isn't even probed at all, and if it doesn't have an extension, you can still rename the file and give it one. Truth is simply that there are systems that don't use extensions, and in order to be compatible with them we should have a proper way to determine filetypes without extensions. You should be able to turn off this behavior as well, but I thought that was kind of a dead giveaway. If you dislike random disk access so much, just turn it off. I for one would certainly like it.

Also, do you perchance use Windows XP? If so, your post is useless. Everytime you open a directory with MP3 files, JPEG files, or AVI files in it (these are KNOWN extensions for gods sake), it probes them ALL, to see what bitrate they are, what the EXIF metadata is, etc. You didn't really like your HDD worn down? Get win95.

NetSlayer
Posts: 36
Joined: Sun Dec 05, 2004 8:55 pm
Contact:

Post by NetSlayer » Sun Feb 06, 2005 12:55 am

mf wrote:Also, do you perchance use Windows XP? If so, your post is useless. Everytime you open a directory with MP3 files, JPEG files, or AVI files in it (these are KNOWN extensions for gods sake), it probes them ALL, to see what bitrate they are, what the EXIF metadata is, etc. You didn't really like your HDD worn down? Get win95.
Yeah, Explorer does that. But _any_ other application that works with file extensions (and so with file types) does _not_ do or need this.
Q: What's tiny and yellow and very, very, dangerous?
A: A canary with the super-user password.

Pentiumforever
Posts: 198
Joined: Sun Jan 16, 2005 5:47 pm
Location: Duesseldorf, Germany
Contact:

Post by Pentiumforever » Sun Feb 06, 2005 12:56 am

I vote for the dos/windows sytem wicht the dot and 3-4 characters!

mf
Developer
Posts: 368
Joined: Mon Dec 27, 2004 2:37 pm
Location: Eindhoven, NL
Contact:

Post by mf » Sun Feb 06, 2005 12:59 am

NetSlayer wrote:Yeah, Explorer does that. But _any_ other application that works with file extensions (and so with file types) does _not_ do or need this.
Did I say so? Read the thread name.

NetSlayer
Posts: 36
Joined: Sun Dec 05, 2004 8:55 pm
Contact:

Post by NetSlayer » Sun Feb 06, 2005 1:04 am

mf wrote:
NetSlayer wrote:Yeah, Explorer does that. But _any_ other application that works with file extensions (and so with file types) does _not_ do or need this.
Did I say so? Read the thread name.
Oh yeah, I'm sorry. ;)

It's just - if you're lookin at Linux - that every application uses this mechanism.
Q: What's tiny and yellow and very, very, dangerous?
A: A canary with the super-user password.

Quigs
Posts: 78
Joined: Sat Dec 04, 2004 7:24 am
Location: USA
Contact:

Post by Quigs » Sun Feb 06, 2005 1:57 am

I dont see the harm in it, but shouldnt this be left to whatever subsystem would require no extensions?

What OS does uses no extension anyway?

And I think Windows explorer already does this because if u rename something to have no extension, and try to open it, it usually suggests the correct application. That feature I like, if that is what you refer to than I say include it :)

Delfi
Posts: 76
Joined: Sat Nov 27, 2004 8:45 pm

Post by Delfi » Sun Feb 06, 2005 2:19 am

oh come on, why do you insist at unix-like file behavour?
in this area you have to admit that windows does its job
really better, it is much easier to compare those 3 letters
against a registry file asociation table than checking whats
in it.. this is especialy useful on removable drives like
scratched cd's..

it is faster, more reliable and more convinient.

quote:
"Truth is simply that there are systems that don't use extensions,
and in order to be compatible with them we should have a
proper way to determine filetypes without extensions."

remember that ROS is triying to reproduce behavour
of windows os, it is not OS based on whole new design, it
uses existing os's design and it will work compatible with
windows - not unix, so why should we try to be compatible
with unix while making a windows-os clone?

so all your arguments in this are meaningless.

React_dude
Posts: 18
Joined: Fri Dec 03, 2004 1:12 am
Contact:

Post by React_dude » Sun Feb 06, 2005 3:50 am

Unix, and there fore linux has weird file extensions. so keep it simple and to the standards so most applications, for example .DOC= word document.... that way hen people see the file extensions they do not freak out because the file ext is unix like, for example, .DOC (windows), .MS_WORD_DOCUMENT (if we went with this idea)
I want to keep the simple tried-and-true methods of the windows file exensions. Remembers, this is a clone of windows.
We need a react OS Update. How would we get by wih out it.

AcetoliNe
Posts: 115
Joined: Wed Jan 05, 2005 10:53 pm
Location: a thousand miles from Hinterland
Contact:

Post by AcetoliNe » Sun Feb 06, 2005 7:05 am

It doesn't sound like a bad idea to me, but the proponents to this idea also have their point...
I have a suggestion. Let's make this into an option in ros-explorer (defualt=off?) and let the user change it if they want. I know at least I'd want to use it sometimes.
Label it something like 'Probe filenames with unknown extensions for filetype' or something even more MS-style-catchier like 'Intelligent File Recognizing'.
caveman LIKES chocolate.
we shall reinvent the wheel until it turns properly.

Phalanx
Posts: 360
Joined: Sun Dec 19, 2004 12:42 am
Location: Australia

Post by Phalanx » Sun Feb 06, 2005 10:54 am

AcetoliNe wrote:It doesn't sound like a bad idea to me, but the proponents to this idea also have their point...
I have a suggestion. Let's make this into an option in ros-explorer (defualt=off?) and let the user change it if they want. I know at least I'd want to use it sometimes.
Label it something like 'Probe filenames with unknown extensions for filetype' or something even more MS-style-catchier like 'Intelligent File Recognizing'.
I dislike the idea as it will mean people will make extensionless files and force people to use this feature, which is a security risk (as normal users could think they are opening a picture when it is a virus or program). It also would kill your hard disk and really slow down your computer, esp. when browsing your hard disk.

And not to mention the size of the program. All those file definitions and ways to tell if the file is one type or another. That is just a joke to have to store that much garbage. Then when a new type comes out, your computer will still not know it. You still have to get a new definition, that many need a code update to be able to tell from another, and is another waste of space. This is just a resource killer than could also make viruses easy. Not to mention, it is not windows (and could force people to have to use this in the future)! Which many people would not like and would force people to use a system that makes viruses much easier. This is one feature I am heavily having even as an option.

mf
Developer
Posts: 368
Joined: Mon Dec 27, 2004 2:37 pm
Location: Eindhoven, NL
Contact:

Post by mf » Sun Feb 06, 2005 3:02 pm

Phalanx, I've heard your story before. Please don't repeat, rather re-read my post. If you still don't understand, please stop with your arguments, they are unfounded. Please think very carefully specifically about your comment of "as normal users could think they are opening a picture when it is a virus or program" - what you are describing is Microsoft's extension hiding, NOT context-sensitive filetype identification. If a file is a virus or a program, a filetype prober will identify it as EXECUTABLE, not as PICTURE. Get it? No? Then shut up, please. I'm losing my patience with people who can't read and don't want to understand.

React_dude, you should also read. I never said we were throwing away the extensions concept. READ FOR F*** SAKE. I'm saying that unidentifiable files could be identified. Jesus, is it THAT hard to understand a simple idea?

Quigs, "What OS does uses no extension anyway?" - Are you that blind or just too lazy to read like the rest? It says in the first paragraph of my post which OSes don't use extensions.

Delfi, research the subsystem concept once more. You will understand.

Asraniel
Posts: 22
Joined: Wed Dec 01, 2004 6:06 pm

Post by Asraniel » Sun Feb 06, 2005 3:16 pm

i see that there are some here that think. ReactOS = windows clone, so, everything windows does is the perfect way and there is no other truth.

With this system you dont have to remove file extensions, its just a addition.

But well, ROS is open source, so everyone can do what he wants with it

Toxigenicpoem
Posts: 29
Joined: Wed Jan 26, 2005 6:48 pm

Post by Toxigenicpoem » Sun Feb 06, 2005 3:23 pm

mf's idea is going a way I like. I understand that ROS is to be a Windows Compatible environment, but its beginning to grow into much more, and to take full advanatage of the GPL license, it would be nice to run *nix programs.

a three letter extension, as and never will be a brilliant idea. Its limiting in its behavior toward developers. I do enjoy the idea of a file header being the main identifier for a complete system, because as MF stated, binaries are binaries, and so fourth. (one of the main functions of CHMOD). I've always wished and to this day I still do, that dos/windows would have CHMOD options on them, but alas they don't.
and place a lot of wear on your hard disk
Guess I dont understand, how this is going to kill your harddrive? By spinning? pls... Thats like people thinking that monitors still have burn-in problems(screen savers are now for entertainment and joy, and lack a real usefullness as they previously did), :shock: , technologies these days have far surpassed those of old.


MF, will this type of file system just check down the line of pre-registerd extionsions?

Also, will it need to be based in the file header information, or in the actual file itsself? I guess I ask in this way, as such on *nix, you can CHMOD a script to be Executible, and the script will execute properly, using the correct interp. Will this be able to happen with 'FileType' ? Or will new registry entries need to be made, linking 'Script' types to thier proper interpreture? (did that even make sense, LOL)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 0 guests