bobby swartz
07-25-2001, 03:11 AM
i was wondering it the linux OS had file extension on its files?
like windows does (eg. .exe, .bat, .com, etc...)
thnx
like windows does (eg. .exe, .bat, .com, etc...)
thnx
|
Click to See Complete Forum and Search --> : linux file extension bobby swartz 07-25-2001, 03:11 AM i was wondering it the linux OS had file extension on its files? like windows does (eg. .exe, .bat, .com, etc...) thnx Dark Ninja 07-25-2001, 03:13 AM NO! :D It is one of the wonderful things about Linux. It does not need these extensions to run (unlike Windows). However, you CAN still put the extensions there if you so choose. It's all up to you. Dark Ninja bobby swartz 07-25-2001, 03:36 AM if there are no extensions how are the differnt file type differinciated? Nalle 07-25-2001, 05:25 AM With permissions. You can set the file executable by changing the permissions example (not executable): -rw-r--r-- 1 nalle users 72 Jul 10 17:01 description example (executable): -r-xr-xr-x 1 nalle users 52 Mar 18 17:28 killnetscape The permissions are devided in 3: Owner Group Other So the first example is read and writeable by the owner and can be read but not altered/deleted by the group or others. The other example is executable and readable by everyone, but writable by noone. I'd have to change permissions to keep working on this file (other than running/reading it). I't set like this so I won't edit it by error. It's a finished script, so I really don't need to edit ti any more. If I try to delete it, I will be asked if I want to override the readonly flag. </nalle> Strike 07-25-2001, 05:35 AM Also, as far as actual file types are determined (not just permissions to them), they use what is called a "magic number", which is a certain set of bytes set to tell certain info about the file. It's kind of like an internal extension. To see what kind of file a file really is file <filename> Here are some examples: [ddipaolo@half-life ~]% file debian1.iso 4:35AM [1009] debian1.iso: ASCII text, with no line terminators [ddipaolo@half-life ~]% file post-IPs 4:35AM [1010] post-IPs: ASCII text [ddipaolo@half-life ~]% file AdobeFnt.lst 4:35AM [1011] AdobeFnt.lst: symbolic link to /dev/null [ddipaolo@half-life ~]% file vimstuff.tar.bz2 4:35AM [1012] vimstuff.tar.bz2: bzip2 compressed data, block size = 900k [ddipaolo@half-life ~]% file src 4:35AM [1013] src: directory [ddipaolo@half-life ~]% file wav/track01.cdda.wav 4:35AM [1014] wav/track01.cdda.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 44100 Hz bobby swartz 07-25-2001, 06:49 AM if each file has a # to it which determines the property of the file , where can i compare that number to all file types? bdg1983 07-25-2001, 08:22 AM There are many good tutorials on Linux filesystems and permissions scattered all over the web. A good one to start with is the Linuxnewbie NHF on File Permissions (http://www.linuxnewbie.org/nhf/intel/filesys/fileperms.html). It should help you to understand a bit more. Strike 07-25-2001, 09:58 AM Originally posted by bobby swartz: <STRONG>if each file has a # to it which determines the property of the file , where can i compare that number to all file types?</STRONG> It is created by the program that creates the file, you have no control over it. This is the way things should be done. bobby swartz 07-25-2001, 08:40 PM is it true that in linux either a file is executable or readable? DMR 07-25-2001, 09:56 PM If you mean permission-wise, it can be either, or both. Consider something like shell scripts; they aren't compiled binaries, but they can still be run (executed). Also, because they are just lines of commands, somewhat like a DOS batch file, they can be read and edited (written to). [ 25 July 2001: Message edited by: DMR ] justlinux.com
Copyright Internet.com Inc. All Rights Reserved. |