## 5 Active File Mode Change Mechanism
If the directory activation ratio is greater than _LMT_, the active file mode change mechanism determines that the activation level of this directory exceeds the reference value and starts to change the file mode of selected files to the local mode. The online mode threshold (_OMT_) is less than or equal to the local mode threshold (_LMT_), and if the directory activation ratio is between _OMT_ and _LMT_, the active file mode change mechanism maintains the current file mode. Figure 6 is a flow chart showing the process of changing the files to the online mode. The low directory activation ratio means that the files are accessed infrequently, and we can make more available local storage by changing these files to the online mode. To this end, the active file mode change mechanism first calculates the used storage ratio (_USR_). _USR_ is the ratio of the currently used capacity to the total storage capacity allocated to the synchronization directory. If the _USR_ is less than or equal to the used storage ratio threshold (_USRT_), then there is no need to change the file to the online mode yet because it means that there is still enough local storage capacity available. In this case, the operation is aborted. If the _USR_ is greater than the threshold, it means that the available space needs to be increased further because the current local storage capacity is being used above the threshold. In this case, the active file mode change mechanism selects files to be changed to the online mode. Since the target of the online mode change is the file with the oldest last access time, the current local mode file list is sorted in ascending order of the last access time, and the file is changed to the online mode in order from the oldest file. Whenever a local mode file is changed to the online mode, the local storage usage ratio (_USR_) decreases by the file size, and the online mode change operation is repeated until this value is less than or equal to the threshold value (_USRT_). Here, the _USRT_ is the criterion for determining whether the active file mode change mechanism needs the online mode change operation from the viewpoint of local storage capacity, and the criterion for determining to what level the _USR_ should be reduced through the online mode change. For example, if the _USRT_ is 0.5, the active file mode change mechanism starts the online mode change when the _USR_ exceeds 50% and ends the online mode change operation when _USR_ falls below 50%. If the _USRT_ is 0, the active file mode change mechanism changes all files in the directory to the online mode. If the _USRT_ is 1, no online mode change operation is performed on any file regardless of the _USR_ value. Figure 5: Flow chart of determining file mode change. When the directory activation ratio becomes greater than the local mode threshold (_LMT_), the active file mode change mechanism initiates a task of changing the online mode files in the directory to the local mode. Figure 7 is a flow chart showing the local mode change process. The local mode change process first calculates the used storage ratio (_USR_) of local storage and compares it with the used storage ratio threshold (_USRT_), which is similar to the online mode change process. If the _USR_ is greater than the threshold (_USRT_), the active file mode change mechanism determines that the local storage is already being used above the threshold and stops the local mode change operation. If the local storage capacity is sufficient, the next task is to select the online mode files for the local mode change. If the client wants to access a large online mode file, the access time is long because the file access needs a delay to download the file from the server. If each user has a maximum amount of access time he/she can tolerate, and if an online mode file of a size that requires a download time longer than this maximum time is preferentially changed to the local mode, the client can keep the average access time within the allowable range.