CodeForge QQ客服 CodeForge 400电话 客服电话 4006316121
首页 » 源代码 » Micrium fs代码 » FS_Time.c

FS_Time.c ( 文件浏览 )

文件源自:Micrium fs代码
  • blackyblack 发布于2015-08-07
  • 浏览次数:0
  • 下载次数:0
  • 下载需 1 积分
  • 侵权举报
			/*
**********************************************************************
*                          Micrium, Inc.
*                      949 Crestview Circle
*                     Weston,  FL 33327-1848
*
*                            uC/FS
*
*             (c) Copyright 2001 - 2006, Micrium, Inc.
*                      All rights reserved.
*
***********************************************************************

----------------------------------------------------------------------
----------------------------------------------------------------------
File        : FS_Time.c
Purpose     : Implementation of file system's time stamp functions
---------------------------END-OF-HEADER------------------------------
*/

/*********************************************************************
*
*       #include Section
*
**********************************************************************
*/
#include "FS_ConfDefaults.h"        /* FS Configuration */
#include "FS_Int.h"
#include "FS_CLib.h"


/*********************************************************************
*
*       Public code, internal code
*
**********************************************************************
*/


/*********************************************************************
*
*       FS__GetFileTime
*
*  Description:
*    Internal version of FS_GetFileTime.
*    Gets the creation timestamp of a given file/directory name.
*
*  Parameters:
*
*/
int FS__GetFileTimeEx(const char * pName, U32 * pTimeStamp, int TimeIndex) {

  int          r;
  int          TypeMask;
  const char * s;
  FS_VOLUME *  pVolume;

  r = -1;
  /* Find correct FSL (device:unit:name) */
  pVolume = FS__FindVolume(pName, &s);
  if (pVolume) {

    if ((FS__AutoMount(pVolume) & FS_MOUNT_R) == FS_MOUNT_R)  {

      switch (TimeIndex) {

      case FS_FILETIME_CREATE:
        TypeMask = FS_DIRENTRY_GET_TIMESTAMP_CREATE;
        break;
      case FS_FILETIME_ACCESS:
        TypeMask = FS_DIRENTRY_GET_TIMESTAMP_ACCESS;
        break;
      case FS_FILETIME_MODIFY:
        TypeMask = FS_DIRENTRY_GET_TIMESTAMP_MODIFY;
        break;
      default:
        return -1;  // Unknown TimeIndex used
      
}
      FS_LOCK_DRIVER(&pVolume->Partition.Device);
      r = FS_GETDIRENTRYINFO(pVolume, s, pTimeStamp, TypeMask);
      FS_UNLOCK_DRIVER(&pVolume->Partition.Device);
    
}
  
}
  return r;

}

/*********************************************************************
*
*       FS_SetFileTime
*
*  Description:
*    Sets the creation timestamp of a given file/directory name.
*
*  Parameters:
*
*/
int FS__SetFileTimeEx(const char * pName, U32 TimeStamp, int TimeIndex) {

  int          r;
  const char * s;
  int          TypeMask;
  FS_VOLUME  * pVolume;

  r = -1;
  /* Find correct FSL (device:unit:name) */
  pVolume = FS__FindVolume(pName, &s);
  if (pVolume) {

    if (FS__AutoMount(pVolume) == FS_MOUNT_RW)  {

      switch (TimeIndex) {

      case FS_FILETIME_CREATE:
        TypeMask = FS_DIRENTRY_SET_TIMESTAMP_CREATE;
        break;
      case FS_FILETIME_ACCESS:
        TypeMask = FS_DIRENTRY_SET_TIMESTAMP_ACCESS;
        break;
      case FS_FILETIME_MODIFY:
        TypeMask = FS_DIRENTRY_SET_TIMESTAMP_MODIFY;
        break;
      default:
        return -1;  // Unknown TimeIndex used
      
}
      FS_LOCK_DRIVER(&pVolume->Partition.Device);
      FS_JOURNAL_BEGIN(pVolume);
      r = FS_SETDIRENTRYINFO(pVolume, s, &TimeStamp, TypeMask);
      FS_JOURNAL_END(pVolume);
      FS_UNLOCK_DRIVER(&pVolume->Partition.Device);
    
}
  
}
  return r;

}

/*********************************************************************
*
*       Public code
*
**********************************************************************
*/

/*********************************************************************
*
*       FS_GetFileTimeEx
*
*  Description:
*    Gets the timestamp of a given file/directory name.
*
*  Parameters:
*
*/
int FS_GetFileTimeEx(const char * pName, U32 * pTimeStamp, int TimeIndex) {

  int  r;
  FS_LOCK();
  r = FS__GetFileTimeEx(pName, pTimeStamp, TimeIndex);
  FS_UNLOCK();
  return r;

}

/*********************************************************************
*
*       FS_SetFileTimeEx
*
*  Description:
*    Sets the timestamp of a given file/directory name.
*
*  Parameters:
*
*/
int FS_SetFileTimeEx(const char * pName, U32 TimeStamp, int Index) {

  int  r;
  FS_LOCK();
  r = 
...
...
(完整源码请下载查看)
			
...
展开> <收缩

下载源码到电脑,阅读使用更方便

1 积分

快速下载
还剩0行未阅读,继续阅读
云测速

源码文件列表

温馨提示: 点击源码文件名可预览文件内容哦 ^_^
...
名称 大小 修改日期
FS_APIValidation.c15.32 kB08-01-08|12:34
FS_CheckDisk.c2.53 kB08-01-08|12:34
FS_DirOperations.c4.80 kB08-01-08|12:34
FS_NORSectorInfo.c3.43 kB08-01-08|12:34
FS_Performance.c7.27 kB08-01-08|12:34
FS_Start.c2.35 kB08-01-08|12:34
Driver_Template.c8.99 kB08-01-08|12:34
IDE_HW.c8.83 kB08-01-08|12:34
ConfigIDE.c5.21 kB08-01-08|12:34
IDE_HW_TemplateMemMapped16Bit.c6.37 kB08-01-08|12:34
IDE_HW_TemplateTrueIDE.c6.67 kB08-01-08|12:34
IDE_HW.c6.33 kB08-01-08|12:34
Readme.txt332.00 B01-10-07|11:55
ConfigMMC_CardMode.c5.26 kB08-01-08|12:34
MMC_CM_HW.c16.48 kB08-01-08|12:34
MMC_CM_HW_Template.c6.59 kB08-01-08|12:34
MMC_CM_HW.c24.07 kB08-01-08|12:34
Readme.txt283.00 B01-10-07|11:55
MMC_HW_SPI.c13.33 kB08-01-08|12:34
MMC_HW_SPI.c15.97 kB08-01-08|12:34
ConfigMMC_SPI.c5.24 kB08-01-08|12:34
MMC_HW_SPI.c10.61 kB08-01-08|12:34
MMC_HW_Template.c5.69 kB08-01-08|12:34
MMC_HW_TemplatePort.c8.69 kB08-01-08|12:34
MMC_HW_SPI.c6.96 kB08-01-08|12:34
Readme.txt552.00 B01-10-07|11:55
ConfigRAMDisk.c5.58 kB08-01-08|12:34
FS_X_embOS.c2.94 kB08-01-08|12:34
FS_X_Epsilon.c2.55 kB08-01-08|12:34
FS_X_ucOS_II.c3.35 kB08-01-08|12:34
FS_X_Win32.c4.69 kB08-01-08|12:34
main.c1.56 kB08-01-08|12:34
Start.c2.35 kB08-01-08|12:34
ConfigRamDisk.c5.58 kB08-01-08|12:34
FS_Conf.h1.12 kB08-01-08|12:34
FS_X_Panic.c1.45 kB08-01-08|12:34
FAT.h4.37 kB08-01-08|12:34
FAT_API.c1.63 kB08-01-08|17:17
FAT_CheckDisk.c26.99 kB08-01-08|17:17
FAT_Dir.c10.28 kB08-01-08|17:17
FAT_DirEntry.c6.12 kB08-01-08|17:17
FAT_DiskInfo.c4.04 kB08-01-08|17:17
FAT_Format.c22.60 kB08-01-08|17:17
FAT_FormatSD.c13.25 kB08-01-08|17:17
FAT_Intern.h10.16 kB08-01-08|12:34
FAT_Ioct.c845.00 B08-01-08|17:17
FAT_LFN.c36.37 kB08-01-08|17:17
FAT_Misc.c42.92 kB08-01-08|17:17
FAT_Move.c5.42 kB08-01-08|17:17
FAT_Open.c22.78 kB08-01-08|17:17
FAT_Read.c8.86 kB08-01-08|17:17
FAT_Rename.c2.11 kB08-01-08|17:17
FAT_SetEndOfFile.c3.99 kB08-01-08|17:17
FAT_VolumeLabel.c6.21 kB08-01-08|17:17
FAT_Write.c15.20 kB08-01-08|17:17
FS.h29.53 kB08-01-08|12:34
FS_AddSpaceHex.c2.24 kB08-01-08|17:17
FS_API.h1.30 kB08-01-08|12:34
FS_AssignCache.c6.11 kB08-01-08|17:17
FS_Attrib.c4.39 kB08-01-08|17:17
FS_CacheAll.c7.50 kB08-01-08|17:17
FS_CacheMan.c7.89 kB08-01-08|17:17
FS_CacheRW.c13.00 kB08-01-08|17:17
FS_CacheRWQuota.c18.46 kB08-01-08|17:17
FS_CLib.c10.51 kB08-01-08|17:17
FS_CLib.h1.53 kB08-01-08|12:34
FS_ConfDefaults.h8.68 kB08-01-08|12:34
FS_CopyFile.c4.69 kB08-01-08|17:17
FS_Core.c19.84 kB08-01-08|17:17
FS_CreateDir.c5.38 kB08-01-08|17:17
FS_Debug.h8.10 kB08-01-08|12:34
FS_Dev.h1.23 kB08-01-08|12:34
FS_DF_X_HW.h1.63 kB08-01-08|12:34
FS_Dir.c11.60 kB08-01-08|17:17
FS_DirOld.c10.47 kB08-01-08|17:17
FS_ErrorNo2Text.c3.67 kB08-01-08|17:17
FS_ErrorOut.c3.40 kB08-01-08|17:17
FS_Format.c4.77 kB08-01-08|17:17
FS_FRead.c1.98 kB08-01-08|17:17
FS_FWrite.c2.05 kB08-01-08|17:17
FS_GetFilePos.c1.66 kB08-01-08|17:17
FS_GetFileSize.c2.59 kB08-01-08|17:17
FS_GetNumFiles.c3.18 kB08-01-08|17:17
FS_GetNumOpenFiles.c1.78 kB08-01-08|17:17
FS_Int.h39.37 kB08-01-08|12:34
FS_Journal.c24.99 kB08-01-08|17:17
FS_Lbl.h1.34 kB08-01-08|12:34
FS_Log.c3.24 kB08-01-08|17:17
FS_LogBlock.c24.42 kB08-01-08|17:17
FS_LogVolume.c10.02 kB08-01-08|17:17
FS_memcpy.c2.99 kB08-01-08|17:17
FS_Misc.c31.49 kB08-01-08|17:17
FS_Move.c2.85 kB08-01-08|17:17
FS_OS.h1.67 kB08-01-08|12:34
FS_OS_Interface.c4.75 kB08-01-08|17:17
FS_Partition.c8.73 kB08-01-08|17:17
FS_Read.c3.83 kB08-01-08|17:17
FS_Rename.c2.43 kB08-01-08|17:17
FS_SetEndOfFile.c3.19 kB08-01-08|17:17
FS_SetFilePos.c2.08 kB08-01-08|17:17
FS_Storage.c10.67 kB08-01-08|17:17
FS_Storage.h4.63 kB08-01-08|12:34
FS_Time.c6.63 kB08-01-08|17:17
FS_Truncate.c1.95 kB08-01-08|17:17
FS_Types.h5.44 kB08-01-08|12:34
FS_Unmount.c6.44 kB08-01-08|17:17
FS_Verify.c4.08 kB08-01-08|17:17
FS_Volume.c29.59 kB08-01-08|17:17
FS_Warn.c3.47 kB08-01-08|17:17
FS_Write.c5.54 kB08-01-08|17:17
FS__ECC256.c7.28 kB08-01-08|17:17
IDE_Drv.c31.24 kB08-01-08|17:17
IDE_X_HW.h1.91 kB08-01-08|12:34
MMC_Drv.c45.22 kB08-01-08|17:17
MMC_SD_CardMode_Drv.c33.01 kB08-01-08|17:17
MMC_SD_CardMode_X_HW.h3.31 kB08-01-08|12:34
MMC_X_HW.h1.81 kB08-01-08|12:34
RAMDISK.c7.40 kB08-01-08|17:17
WinDrive.c12.64 kB08-01-08|17:17
FS_Start.dsp10.71 kB17-10-07|09:25
FS_Start.dsw539.00 B01-10-07|11:55
FS_Start_EFS.dsp10.61 kB17-10-07|10:22
FS_Start_EFS.dsw547.00 B16-10-07|17:29
Global.h1.68 kB08-01-08|12:34
Release_uC-FS.html12.52 kB08-01-08|11:55
uC-FS-UserManual-V3-10.pdf3.99 MB18-12-07|14:02
Cogent_EP73120.00 B08-01-08|12:34
LogicPD_LH795200.00 B08-01-08|12:34
LogicPD_LH7A4040.00 B08-01-08|12:34
NXP_LPC23xx0.00 B08-01-08|12:34
Atmel_AT91SAM7S0.00 B08-01-08|12:34
Atmel_AT91SAM92610.00 B08-01-08|12:34
LogicPD_LH795200.00 B08-01-08|12:34
NXP_LPC214x0.00 B08-01-08|12:34
DriverTemplate0.00 B08-01-08|12:34
IDE0.00 B08-01-08|12:34
MMC_CM0.00 B08-01-08|12:34
MMC_SPI0.00 B08-01-08|12:34
RAM0.00 B08-01-08|12:34
API0.00 B08-01-08|12:34
Driver0.00 B08-01-08|12:34
OS0.00 B08-01-08|12:34
Sample0.00 B08-01-08|12:34
Application0.00 B08-01-08|12:34
Config0.00 B08-01-08|12:34
FS0.00 B08-01-08|12:34
Inc0.00 B08-01-08|12:34
uC-FS0.00 B15-10-08|11:25
Software0.00 B08-01-08|12:34
Micrium0.00 B08-01-08|12:34
Micrium-uC-FS-V3-10h-SEC_Navigator0.00 B15-10-08|11:23
Micrium-uC-FS-V3-10h_doc0.00 B15-10-08|12:12
云测速

FS_Time.c (3.37 MB)

需要 1 积分
您持有 积分

CodeForge积分(原CF币)全新升级,功能更强大,使用更便捷,不仅可以用来下载海量源代码马上还可兑换精美小礼品了 了解更多

您的积分不足

支付宝优惠套餐快速获取 30 积分

订单支付完成后,积分将自动加入到您的账号。以下是优惠期的人民币价格,优惠期过后将恢复美元价格。

更多付款方式:网银PayPal

上传代码,免费获取

您本次下载所消耗的积分将转交上传作者。

同一源码,30天内重复下载,只扣除一次积分。

登录 CodeForge

还没有CodeForge账号? 立即注册
关注微博
联系客服

Switch to the English version?

Yes
CodeForge 英文版
No
CodeForge 中文版

完善个人资料,获价值¥30元积分奖励!

^_^"呃 ...

Sorry!这位大神很神秘,未开通博客呢,请浏览一下其他的吧
好的