Lucene.Net.Store.RAMDirectory.TouchFile C# (CSharp) Method

TouchFile() public method

Set the modified time of an existing file to now.
public TouchFile ( System name ) : void
name System
return void
		public override void  TouchFile(System.String name)
		{
			EnsureOpen();
			RAMFile file;
			lock (this)
			{
				file = fileMap[name];
			}
			if (file == null)
				throw new System.IO.FileNotFoundException(name);
			
			long ts2, ts1 = System.DateTime.UtcNow.Ticks / TimeSpan.TicksPerMillisecond;
			do 
			{
				try
				{
					System.Threading.Thread.Sleep(new System.TimeSpan((System.Int64) 10000 * 0 + 100 * 1));
				}
				catch (System.Threading.ThreadInterruptedException ie)
				{
					// In 3.0 we will change this to throw
					// InterruptedException instead
					ThreadClass.Current().Interrupt();
					throw new System.SystemException(ie.Message, ie);
				}
                ts2 = System.DateTime.UtcNow.Ticks / TimeSpan.TicksPerMillisecond;
			}
			while (ts1 == ts2);
			
			file.LastModified = ts2;
		}