Wie lang darf eine Dateiendung unter Windows sein?
-
Hallo!
Ich würde mir gerne mehrere Dateiendungen ausdenken und um dabei ein brauchbares Schema hinzukriegen brauche ich mind. 4 eher 6 Stellen hinter dem Punkt.
Es geht um Druckformularforlagen von List&Label.Deren Dialog kann man eine gewünschte Endung geben und dann werden nur die passenden angezeigt.
Das gefällt mir und ich möchte es nutzen.Nun möchte ich mir was ausdenken, dass ich sowas bekomme:
*.adknde: Kunde einzeln drucken
*.adkndl: Kundenliste drucken
*.adfrme: Firma einzeln drucken
*.adrfml: Firmenliste drucken
usw.
Das ad vorne ist eigentlich nur ne Kennzeichnung, dass es zu meiner Anwendung gehört.Wäre das okay? Oder verstößt das gegen irgendeine Konvention?
Oder kann eine Windowsversion ab Win98 das nicht?
-
stdlib.h schrieb:
#define _MAX_PATH 260 /* max. length of full pathname /
#define _MAX_DRIVE 3 / max. length of drive component /
#define _MAX_DIR 256 / max. length of path component /
#define _MAX_FNAME 256 / max. length of file name component /
#define _MAX_EXT 256 / max. length of extension component */demnach also _MAX_EXT (255 zeichen + 0). es kommt natürlich noch vor, dass programme streiken wenn der dateiname jenseits von 8.3 ist
-
Also alle aktuellen Windows-Versionen unterstützen Dateinamen bis 256 Zeichen (oder mittlerweile sogar noch größer?) und sowas wie Dateiendung ist glaub ich auch völlig irrelevant. Wird unter Windows bzw. NTFS als ein Dateiname betrachtet, also der Punkt ist ein Zeichen wie jedes andere.
Wie es unter Win98 ist, weiß ich nicht.
-
Okay, dann werde ich es einfach mal testen.
Danke.
-
Hmmm noch was in der MSDN gefunden.
MSDN schrieb:
Long vs. Short File Extensions
File names in the 8.3 format (that is, a file name of one to eight characters, separated by a period from an extension of up to three characters) are an artifact from the days of MicrosoftMS-DOS
. For example command.com and config.sys are file names in 8.3 format. The restriction of file names to the 8.3 format often causes file names to appear cryptic. Support for long file names was introduced in Microsoft Windows
95 and Microsoft Windows NT
Version 3.51. All current Windows file systems (FAT16, FAT32, and NTFS) support long file names.
A mentality from the days of the 8.3 file names maintains that extensions cannot exceed three characters. While this limitation no longer holds, it is still common practice to limit extensions to three characters. File name extensions that adhere to this artificial limitation are commonly called short extensions. A long extension is any extension longer than three characters.
In addition to causing cryptic file names, the limited length of short extensions increases the probability of an extension collision. An extension collision occurs when files that contain different types of data are identified by the same extension. Long extensions are preferred over short extensions because they decrease the chances of an extension collision, and users tend to understand them more easily.
It is recommended that you define both a short and long file name extension for a file type, and that you favor the long file name extension when creating files. The long extension is not limited to a specific number of characters, but you should still make it brief. At the minimum, you should append a vendor abbreviation. For example, you can expand the short file extension .doc to the long extension .doc-msword.
Steht zwar nix genaues zur Länge, aber da ja MAX_PATH und all das Zeugs immer um 256 liegt, dann wird es wohl schon so sein, wie net es geschrieben hat. Aber wer setzt schon eine Dateiendung von einer Länger von 255 fest XD
Grüssli