last-modified

What takes precedence: the ETag or Last-Modified HTTP header?

亡梦爱人 提交于 2019-11-28 03:11:15
For two subsequent requests, which of the following two headers is given more weight by browsers should one of them change: ETag or Last-Modified? Thomas S. Trias According to RFC 2616 section 13.3.4, an HTTP 1.1 Client MUST use the ETag in any cache-conditional requests, and if both an ETag and Last Modified are present, it SHOULD use both. The ETag header is considered a strong validator (see section 13.3.3), unless explicitly declared weak by the server, whereas the Last Modified header is considered weak unless at least a minute difference exists between it and the Date header. Note,

Loop through ALL files in a folder based on 'Last Modified Date'

泄露秘密 提交于 2019-11-27 20:55:12
I need to loop through the files in a given folder in descending order of 'Last Modified Date'. In the first iteration of the loop I need to be able to open the most recently modified file for reading and close it. In the second iteration, I need to be able to open the 2nd most recently updated file for reading and close it etc. Is there a built in method that allows a FileSystemObject to sort the files or do we absolutely have to write custom sorting routine? If we have to go with a custom sorting routine, is it possible to write this without having multiple functions? i.e. all code in the a

Check last modified date of file in C#

半世苍凉 提交于 2019-11-27 14:15:41
I'm looking to find out a way of seeing when a file was last modified in C#. I have full access to the file. Dean Harding System.IO.File.GetLastWriteTime is what you need. You simply want the File.GetLastWriteTime static method. Example: var lastModified = System.IO.File.GetLastWriteTime("C:\foo.bar"); Console.WriteLine(lastModified.ToString("dd/MM/yy HH:mm:ss")); Note however that in the rare case the last-modified time is not updated by the system when writing to the file (this can happen intentionally as an optimisation for high-frequency writing, e.g. logging, or as a bug), then this

How to check if directory contents has changed with PHP?

半腔热情 提交于 2019-11-27 12:24:41
I'm writing a photo gallery script in PHP and have a single directory where the user will store their pictures. I'm attempting to set up page caching and have the cache refresh only if the contents of the directory has changed. I thought I could do this by caching the last modified time of the directory using the filemtime() function and compare it to the current modified time of the directory. However, as I've come to realize, the directory modified time does not change as files are added or removed from that directory (at least on Windows, not sure about Linux machines yet). So my questions

How does maven compile only the modified java files?

冷暖自知 提交于 2019-11-27 07:36:53
问题 I was just curious to know this, when i give mvn install without doing 'clean', maven compiles only the modified java files. How does maven identify a java file is modified or not? I believe it is not using the last modified property of the file. Reason for my belief: I had a module, after merging a change from svn, i gave mvn install and it didn't compile the modified file and when i looked at the change i saw that 'long' were modified to 'Long' in getters and setters. So i just want to know

How do I find the last modified file in a directory in Java?

断了今生、忘了曾经 提交于 2019-11-26 22:33:10
How do I find the last modified file in a directory in java? Bozho private File getLatestFilefromDir(String dirPath){ File dir = new File(dirPath); File[] files = dir.listFiles(); if (files == null || files.length == 0) { return null; } File lastModifiedFile = files[0]; for (int i = 1; i < files.length; i++) { if (lastModifiedFile.lastModified() < files[i].lastModified()) { lastModifiedFile = files[i]; } } return lastModifiedFile; } Combine these two: You can get the last modified time of a File using File.lastModified() . To list all of the files in a directory, use File.listFiles() . Note

Loop through ALL files in a folder based on 'Last Modified Date'

耗尽温柔 提交于 2019-11-26 20:29:51
问题 I need to loop through the files in a given folder in descending order of 'Last Modified Date'. In the first iteration of the loop I need to be able to open the most recently modified file for reading and close it. In the second iteration, I need to be able to open the 2nd most recently updated file for reading and close it etc. Is there a built in method that allows a FileSystemObject to sort the files or do we absolutely have to write custom sorting routine? If we have to go with a custom

How to check if directory contents has changed with PHP?

蓝咒 提交于 2019-11-26 15:59:33
问题 I'm writing a photo gallery script in PHP and have a single directory where the user will store their pictures. I'm attempting to set up page caching and have the cache refresh only if the contents of the directory has changed. I thought I could do this by caching the last modified time of the directory using the filemtime() function and compare it to the current modified time of the directory. However, as I've come to realize, the directory modified time does not change as files are added or

Check last modified date of file in C#

和自甴很熟 提交于 2019-11-26 14:10:03
问题 I'm looking to find out a way of seeing when a file was last modified in C#. I have full access to the file. 回答1: System.IO.File.GetLastWriteTime is what you need. 回答2: You simply want the File.GetLastWriteTime static method. Example: var lastModified = System.IO.File.GetLastWriteTime("C:\foo.bar"); Console.WriteLine(lastModified.ToString("dd/MM/yy HH:mm:ss")); Note however that in the rare case the last-modified time is not updated by the system when writing to the file (this can happen

How do I find the last modified file in a directory in Java?

落花浮王杯 提交于 2019-11-26 08:23:53
问题 How do I find the last modified file in a directory in java? 回答1: private File getLatestFilefromDir(String dirPath){ File dir = new File(dirPath); File[] files = dir.listFiles(); if (files == null || files.length == 0) { return null; } File lastModifiedFile = files[0]; for (int i = 1; i < files.length; i++) { if (lastModifiedFile.lastModified() < files[i].lastModified()) { lastModifiedFile = files[i]; } } return lastModifiedFile; } 回答2: Combine these two: You can get the last modified time of