File-name extension characters for file distribution

A file is written or not written to a first storage medium (as opposed to a second storage medium) as a function of its distribution-priority file-name extension character or characters and an available capacity of the first storage medium. A system includes a manufacture in the form of a computer-readable storage medium tangibly encoded with software. The software includes an operating system that, when executed, selects a first storage medium or a second storage medium to which to write a target file as a function of distribution-priority file-name extension characters of a file name for the target file and of available capacity on the first storage medium.

BACKGROUND

As it has become more affordable, capacious solid-state memory has increasingly assumed the mass storage role conventionally occupied by hard disks. Solid-state drives (SSDs) tend be faster, more robust, and more power efficient that hard-disk drives (HDDs). Thus, some computers include SSDs in lieu of HDDs. However, SSDs are (presently) more expensive than HDDs for a given storage capacity so computers with HDDs remain prevalent.

DETAILED DESCRIPTION

A computer can include a SSD and a HDD to obtain the advantages of each. An operating system for such a computer determines whether to write a file to the SSD or the HDD (or both). This is a special case of distributing files between a smaller faster storage device and a larger slower storage device. Herein, some example embodiments disclose using file-name extensions to prioritize files for writing to the smaller-faster SSD.

As shown inFIG. 1, a computer system API includes processors11, communications devices13, and computer-readable storage media15. Media15includes manufactures in the form of a solid-state drive (SSD)17and a hard-disk drive (HDD)19. Collectively they store tangible memory states constituting software20, including data21, applications23, and an operating system25. Operating system25includes a number of “dynamically-linked-library” or “DLL” files31-51.

Each DLL file is given a file name that includes a base, a period, and an extension. For example, DLL file31has the file name “HIGHEST,DLLs1”. (Note uppercase and lower case are not distinguished in these file names.) This file name includes a base “HIGHEST”, a period, and an extension “DLLs1”. The extension includes two sections: the first three characters “DLL” are file-type extension characters and define a Me type for file31. The last two characters are “distribution-priority” characters and are used to help determine whether they are written to smaller-faster SSD17or larger-slower HDD19. In the case of file31, the fourth character is an “s”, indicating it is to be stored in SSD17if possible; the fifth character is a “1” indicating it has the highest priority for storage in SSD17. It is to be stored in SSD17(as indicated inFIG. 1) unless SSD17is already full with highest-priority files.

File32has a file name “HIGHER.DLLs2”. In this case, the fourth character is “s”, indicating the file is to be stored preferentially in SSD17. However, fifth character is a “2” (as opposed to “1” for file31), indicating its priority rating is below that of files with distribution-priority s1. Thus, file32could be removed from solid-state disk17to make room for file31. On the other hand, file32would not be removed to make room for files with fifth characters of “3” (e.g., file33), “4” (e.g., file34), or “5” (e.g., file35). Note that files32-35are shown inFIG. 1as straddling an abstract boundary between SSD17and HDD19. This straddling corresponds very schematically to probability distribution of finding a file in SSD17versus finding it in HDD19. (Straddling does not indicate that the file is partially stored in SSD17and partially stored in HDD19.)

File36has a distribution-priority extension section “s”, without a fifth character. This is treated as a preference for storage in SSD17, but with a lower priority than a file with an “s5” distribution-priority extension section. For file37, the fourth extension character is “Ii” and there is no fifth character. The “h” indicates that file37is to be preferentially stored on HDD19. No fifth character is used to indicate priority since HDD19is presumably sufficiently capacious that file37will fit without moving files to SSD17.

File38has a file name (ZERO.DLL) with a file-type extension section but no distribution-priority extension characters. In the illustrated embodiment, such a file is treated as if it had an “s” extension with no fifth character; in other words it is treated as if it had an “h” for the fourth character. In an alternative embodiment, a file lacking distribution-priority extension characters is treated as if it had an s3extension. In another embodiment, such a file is distributed according to file type (or its file-type extension section).

For some files, e.g., files39-50, it is preferably to store then in both SSD17and HDD19, e.g., for backup. The fourth character “m” is used as the fourth character in these files. Thus, inFIG. 1, files39and40are duplicates and have the same file name “HIGHEST.DLLM1”. Such “m” files can have a priority indicator of 1-5, this fifth character has the same basic meaning as the fifth character for the “s” files. Thus, file45, which has a distribution-priority extension of “m3” has a priority higher than file34(with an s4), but lower than file32(with an s2). However, in the case of a tie at the fifth character, the file with the “s” extension has priority over the file with the “m” extension, since the latter has a copy on HDD19. If an “m” file is removed from SSD17to make room for a higher-priority file, it is simply deleted rather than moved (as an “s” file would be”) because of the copy already in place on HDD19. How these distribution-priority characters are used is explained further with reference to a method flow charted inFIG. 2.

FIG. 2is a flow chart of a method ME1in accordance with an embodiment of the invention. Method segment M1invoking assigning distribution-priority file-name extensions to files. This extension may be may or may not be in addition to another extension, e.g., a file-type extension. In the case where there is more than one extension type, the distribution-priority extension can be identified by an absolute position (e.g., 4thand 5thcharacters) or position relative to some delimiter within the extension (e.g., a period or other separator within the extension). If a preceding extension (e.g., file-type extension) has a fixed length, the distribution priority section can begin at the end of that. If it has a variable length, the preceding extension can be filled in with default values to a fixed length.

In the embodiment ofFIG. 1, an “s” as the fourth-character used to indicate a preference for an SSD or other faster-smaller storage medium. “h” is used to indicate a preference for a HDD or other slower-larger storage medium. “m” is used for a preference for writing a file to both media. Other characters can be used, as can values other than 1-5 for indicating priority rankings.

At method segment M2, files be written are distributed between media as indicated by the distribution-priority extension characters. Method segment M2is detailed inFIG. 3. At step S1, an operating system checks the fourth character of a file-name extension for a target file. Step S2involves determining whether the fourth character is or is not “s”. If it is, step S3calls for checking to determine with there is room on an SSD for writing the target file. If there is room, then step S4calls for writing the target file to the SSD.

If at step S3, it is determined that there is not enough room for the target file, then at step S5, the operating system checks the 5thcharacter of the file-name extension of the target file. This character can be a “1”-“5” or be absent, which is treated as if it were a “6”, in other words, has the lowest priority.

At step S6, the operating system determines whether or not there is a file with a lower priority than the target file, i.e., has a higher priority number. If there is such a lower-priority file, it is moved to the hard disk at step S7. At this point, method segment S2returns to step S3to see if there is now sufficient room on the SSD. If there is sufficient room, the target file is written to the SSD. If there is not, another lower-priority file can be moved at S7. However, if it is not possible to make room for the target file by moving lower priority files, as determined at an iteration of S6, then the target file is written to the hard disk at step S8.

If at step S2, the operating system determines that the fourth character is not an “s”, step S9checks to determine if it is an “m” instead. If it is not an “m” (or an “s”), it is written to the HDD at step S8. Note that if the fourth character is not an “s” or an “m” is it either an “h” (indicating a preference for the hard disk, or absent, indicating a very low priority. In either case, the writing to the HDD is appropriate.

If at step S9, the operating system determines that the fourth character is “m”, then it also writes the target file to the HDD. However, in the case of an “m”, method segment M2branches to S3to determine if a copy of the target file should be written to the SSD. From step S3, method segment S2proceeds as it would with an “s” file to determine whether or not to write the target file to the SSD. The exception is that, if at step S6, there is no room on the SSD that can be cleared by moving lower priority files, the “m” file is not written a second time to the HDD.

If the naming scheme varies from that used inFIG. 1, method ME1and step S2will vary accordingly. These and other variations upon and modifications to the illustrated embodiment are provided for by the present invention, the scope of which is defined by the following claims.