当前位置: 首页>>代码示例>>C#>>正文


C# FileReference.Delete方法代码示例

本文整理汇总了C#中FileReference.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# FileReference.Delete方法的具体用法?C# FileReference.Delete怎么用?C# FileReference.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileReference的用法示例。


在下文中一共展示了FileReference.Delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Load

		/// <summary>
		/// Loads the cache from disk
		/// </summary>
		/// <param name="Cache">The file to load</param>
		/// <returns>The loaded instance</returns>
		public static FlatCPPIncludeDependencyCache Load(FileReference BackingFile)
		{
			FlatCPPIncludeDependencyCache Result = null;
			try
			{
				string CacheBuildMutexPath = BackingFile.FullName + ".buildmutex";

				// If the .buildmutex file for the cache is present, it means that something went wrong between loading
				// and saving the cache last time (most likely the UBT process being terminated), so we don't want to load
				// it.
				if (!File.Exists(CacheBuildMutexPath))
				{
					using (File.Create(CacheBuildMutexPath))
					{
					}

					using (BinaryReader Reader = new BinaryReader(new FileStream(BackingFile.FullName, FileMode.Open, FileAccess.Read)))
					{
						// @todo ubtmake: We can store the cache in a cheaper/smaller way using hash file names and indices into included headers, but it might actually slow down load times
						// @todo ubtmake: If we can index PCHs here, we can avoid storing all of the PCH's included headers (PCH's action should have been invalidated, so we shouldn't even have to report the PCH's includes as our indirect includes)
						if (Reader.ReadInt32() == FileSignature)
						{
							Result = Deserialize(Reader);
						}
					}
				}
			}
			catch (Exception Ex)
			{
				Console.Error.WriteLine("Failed to read FlatCPPIncludeDependencyCache: {0}", Ex.Message);
				BackingFile.Delete();
			}
			return Result;
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:39,代码来源:FlatCPPIncludeDepencencyCache.cs

示例2: Load

		/// <summary>
		/// Loads the cache from the passed in file.
		/// </summary>
		/// <param name="Cache">File to deserialize from</param>
		public static DependencyCache Load(FileReference CacheFile)
		{
			DependencyCache Result = null;
			try
			{
				string CacheBuildMutexPath = CacheFile.FullName + ".buildmutex";

				// If the .buildmutex file for the cache is present, it means that something went wrong between loading
				// and saving the cache last time (most likely the UBT process being terminated), so we don't want to load
				// it.
				if (!File.Exists(CacheBuildMutexPath))
				{
					using (File.Create(CacheBuildMutexPath))
					{
					}

					using (BinaryReader Reader = new BinaryReader(new FileStream(CacheFile.FullName, FileMode.Open, FileAccess.Read)))
					{
						if (Reader.ReadInt32() == FileSignature)
						{
							Result = DependencyCache.Deserialize(Reader);
						}
					}
				}
			}
			catch (Exception Ex)
			{
				Console.Error.WriteLine("Failed to read dependency cache: {0}", Ex.Message);
				CacheFile.Delete();
			}
			return Result;
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:36,代码来源:DependencyCache.cs


注:本文中的FileReference.Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。