HFS: File masks: Difference between revisions

From rejetto wiki
Jump to navigation Jump to search
No edit summary
(e)
Line 11: Line 11:
== L'asterisco (*) ==
== L'asterisco (*) ==


The star (also called "asterisk") stands for ''any string'' of characters. If the mask contains only the star, it matches ANY file.
La stella (anche denominata "asterisco") corrisponde a: ''qualsiasi stringa'' di caratteri.<br>Se la maschera file contiene solo l'asterisco, denoterà QUALSIASI tipo di file..


If you put an A before the star <tt>A*</tt>, it matches any file starting with an A.
Se inserisci la lettera A prima dell'asterisco <tt>A*</tt>, denoterà qualsiasi file che inizia per A.


If you put an A after the star <tt>*A</tt>, it matches any file ending with an A.
Se inserisci la lettera A dopo l'asterisco <tt>*A</tt>, denoterà qualsiasi file che finisce per A.


<tt>A*B</tt> matches any file starting with an A and ending with a B.
<tt>A*B</tt> denota qualsiasi file che inizia con una A e finisce con una B.<br>
The example above shows ''*.jpg'' : it matches any file ending with .jpg (that is, jpeg images). jpeg files are relatively unusual because they sometimes end with ''.jpeg'' and more rarely with ''.jpe'' . (The part of a filename that comes after the period is called the file "extension", and is normally limited to three characters.)  You could use the mask .jp* to match all types of jpeg files.
L'esempio precedente visualizza una maschera per  ''*.jpg'' che denota qualsiasi file la cui denominazione termina con .jpg (che corrisponde al tipo immagine jpeg).<bRI file jpeg possono essere relativamente inusuali in quanto di solito terminano con ''.jpeg'' e più raramente con ''.jpe'' . (The part of a filename that comes after the period is called the file "extension", and is normally limited to three characters).<br>Puoi usare la maschera .jp* per denotare tutti i tipi di files jpeg.


The star also matches the ''null string'': <tt>A*.jpg</tt> matches files like ''A1.jpg'' , ''Adfgg.jpg''
The star also matches the ''null string'': <tt>A*.jpg</tt> matches files like ''A1.jpg'' , ''Adfgg.jpg''

Revision as of 23:02, 10 January 2007

Cos'è?

Una maschera file ("file mask") denota un set di files.
Un esempio potrebbe essere il seguente: *.jpg;*.gif.
Questo modello denota ogni file con estensione .jpeg e .gif.
Ricorda che i caratteri usati nei nomi dei files non sono "case sensitive": per cui *.jpg e *.JPG (cioè scritto in minuscolo e/o maiuscolo) riferisce esattamente allo stesso set di files.

Come funziona?

L'esempio precedente mostra una doppia maschera file.
Presenta due elementi separati da punto e virgola (;): *.jpg e *.gif.
Il punto e virgola è utilizzato per unire maschere multiple essendo, infatti, un carattere "speciale".
Nelle maschere file possono esistere esclusivamente tre tipi di carattere speciale: ; * e ?.

L'asterisco (*)

La stella (anche denominata "asterisco") corrisponde a: qualsiasi stringa di caratteri.
Se la maschera file contiene solo l'asterisco, denoterà QUALSIASI tipo di file..

Se inserisci la lettera A prima dell'asterisco A*, denoterà qualsiasi file che inizia per A.

Se inserisci la lettera A dopo l'asterisco *A, denoterà qualsiasi file che finisce per A.

A*B denota qualsiasi file che inizia con una A e finisce con una B.
L'esempio precedente visualizza una maschera per *.jpg che denota qualsiasi file la cui denominazione termina con .jpg (che corrisponde al tipo immagine jpeg).<bRI file jpeg possono essere relativamente inusuali in quanto di solito terminano con .jpeg e più raramente con .jpe . (The part of a filename that comes after the period is called the file "extension", and is normally limited to three characters).
Puoi usare la maschera .jp* per denotare tutti i tipi di files jpeg.

The star also matches the null string: A*.jpg matches files like A1.jpg , Adfgg.jpg but also A.jpg.

Il punto interrogativo (?)

This stands for a single character. Something like A?B matches any filename that is three characters long and starts with an A and ends with a B. The length is fixed to three characters because ? can be replaced by only one character. Thus the ? does not match the null string as the * does.