13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

10Chapter 1An Embarrassment of Riches: The <strong>Linux</strong> Envir<strong>on</strong>mentFilenames are case sensitive—upper- and lowercase names are different.The files ReadMe.txt and readme.txt could both be in the same directory;they are distinct files.Avoid using spaces in filenames, as the shell uses whitespace to delineatebetween arguments <strong>on</strong> a command line. You can put a blank in a name, butthen you always have to put the name in quotes to refer to it in the shell.To give a filename more visual clues, use a period or an underscore.You can combine several in <strong>on</strong>e filename, too. The filenamesread_me_before_you_begin or test.data.for_my_program may beannoyingly l<strong>on</strong>g to type, but they are legal filenames.NOTEThe period, or “dot,” in <strong>Linux</strong> filenames has no special meaning. If you comefrom the MS-DOS world, you may think of the period as separating the filenamefrom the extensi<strong>on</strong>, as in myprogrm.bas where the filename is limited to eightcharacters and the extensi<strong>on</strong> to three characters. Not so in <strong>Linux</strong>. There is no“extensi<strong>on</strong>,” it’s all just part of the filename.You will still see names like delim.c or Account.java, but the .c or.java are simply the last two characters or the last five characters, respectively,of the filenames. That said, certain programs will insist <strong>on</strong> those endings fortheir files. The Java compiler will insist that its source files end in .java andwill produce files that end in .class—but there is no special part of the filenameto hold this. This will prove to be very handy, both when you name yourfiles and when you use patterns to search for files (see below).1.3.4 Permissi<strong>on</strong>sPermissi<strong>on</strong>s in <strong>Linux</strong> are divided into three categories: the owner of a file(usually the user who created it), the group (a collecti<strong>on</strong> of users), and others,meaning every<strong>on</strong>e who is not the owner and not in the group. Any file bel<strong>on</strong>gsto a single owner and, simultaneously, to a single group. It has separateread/write/execute permissi<strong>on</strong>s for its owner, its group, and all others. If youare the owner of a file, but also a member of the group that owns the file, thenthe owner permissi<strong>on</strong>s are what counts. If you’re not the owner, but a memberof the group, then the group permissi<strong>on</strong>s will c<strong>on</strong>trol your access to the file. Allothers get the “other” permissi<strong>on</strong>s.If you think of the three permissi<strong>on</strong>s, read/write/execute, as three bits ofa binary number, then a permissi<strong>on</strong> can be expressed as an octal digit—wherethe most significant bit represents read permissi<strong>on</strong>, the middle bit is write

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!