last-modified

Is there something like Perl's Win32::FileNotify for Linux or OS X?

柔情痞子 提交于 2019-12-20 03:20:00
问题 I've been using Win32::FileNotify on Windows, and I was curious to know if there were something similar for Linux and OS X. I haven't been able to find such a module using Google. Does anyone here know of such a thing? 回答1: File::ChangeNotify sounds like a cross-platform way to do this. 回答2: For systems where famd can run (Irix, Linux, BSDs, most Unices) there is SGI::FAM and Sys::Gamin, both of which do not build straight out of CPAN or tarball, but do work well once you get them working.

Check if file was modified after xx days in the past

我们两清 提交于 2019-12-20 01:38:12
问题 I am checking for the date modified in a file. I would like to test whether the file was modified after the /d -3 . According to the docs, this will check if the file was modified before that date. I need to check if the file was modified after that date. The docs also state that I can specify a date. I might end up doing it this way though it would be a little more complicated to generate a date to check against which I would prefer to avoid if possible. How might I go about this? forfiles

How can I get last modified timestamp in Lua

帅比萌擦擦* 提交于 2019-12-19 09:24:00
问题 I am trying to work on Lua file handling. So, I am able to open, read, write, close the files. local session_debug = io.open("/root/session_debug.txt", "a") session_debug:write("Some text\n") session_debug:close() How can I know the last modified date timestamp of this file. 回答1: There's no built-in function in standard Lua that does this. One way to get it without third-party libraries is to take use of io.popen . For example, on Linux, you could use stat: local f = io.popen("stat -c %Y

ASP.NET MVC getting last modified date/FileInfo of View

核能气质少年 提交于 2019-12-19 03:54:06
问题 I'm required to include the last modified date on every page of my applications at work. I used to do this by including a reference to <%= LastModified %> at the bottom of my WebForms master page which would return the last modified date of the current .aspx page. My code would even check the associated .aspx.cs file, compare the last modified dates, and return the most recent date. Does anyone know if you can read the FileInfo of a MVC View? I would like to include it in the master page, if

How to get File Created Date and Modified Date [duplicate]

非 Y 不嫁゛ 提交于 2019-12-18 13:51:47
问题 This question already has answers here : Check last modified date of file in C# (4 answers) Closed 5 years ago . I have an .NET EXE file . I want to find the file created date and modified date in C# application. Can do it through reflection or with IO stream? 回答1: You could use below code: DateTime creation = File.GetCreationTime(@"C:\test.txt"); DateTime modification = File.GetLastWriteTime(@"C:\test.txt"); 回答2: You can do that using FileInfo class: FileInfo fi = new FileInfo("path"); var

Batch file: Iterate over files modified since a given date

给你一囗甜甜゛ 提交于 2019-12-18 07:13:27
问题 I want to create a batch file that executes a command (delete the file, for a simple example, though my command is custom/different) on each file matching a wildcard (say *.jpg) that was modified since some date (such as 1-1-2010 or later). The date can either be hardcoded in the batch file or passed as a command line parameter. Pseudocode: foreach file C:\Images\*.jpg modified-since 1-1-2010 do del file I'd prefer a pure batch file, not PowerShell, VBScript, etc. If using pure batch language

Batch file: Iterate over files modified since a given date

陌路散爱 提交于 2019-12-18 07:12:06
问题 I want to create a batch file that executes a command (delete the file, for a simple example, though my command is custom/different) on each file matching a wildcard (say *.jpg) that was modified since some date (such as 1-1-2010 or later). The date can either be hardcoded in the batch file or passed as a command line parameter. Pseudocode: foreach file C:\Images\*.jpg modified-since 1-1-2010 do del file I'd prefer a pure batch file, not PowerShell, VBScript, etc. If using pure batch language

Get Creation Date of a file on the web

邮差的信 提交于 2019-12-13 06:58:38
问题 I know this question was already asked here: Get File Creation Date Over HTTP BUT, I didn't get the answer needed. I don't want to get the "Last Modified" date. Instead I want the creation date. The following code gets me the last modified date from the headers. Dim request As System.Net.HttpWebRequest = DirectCast(WebRequest.Create("http://10.20.80.111/mobilepayment/myfile.crt"), System.Net.HttpWebRequest) Dim lastmodified As String Using response As WebResponse = request.GetResponse()

Delete files older 6 months

最后都变了- 提交于 2019-12-12 14:55:41
问题 I want delete files in a folder, which are more than six months old -older than 6 months-using Msbuild. I want use %ModifiedTime (Well-known Item Metadata) of MsBuild I prefer not use customs Tasks, only msbuild default and Microsoft.Sdc.Tasks. I use VS 2008, .net .35. Any suggestions ? <Target Name="SomeTarget"> <ItemGroup> <FilesToDelete Include="Path\**\*.zip"/> </ItemGroup> <Delete Files="@(FilesToDelete)" /> </Target> 回答1: I think you can achieve this without need to use custom tasks in

htaccess 'Header unset Last-Modified' caching issue

徘徊边缘 提交于 2019-12-12 09:44:47
问题 Im trying to set up some cache control options in my htaccess file. At the moment it looks like this: <FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|swf|css|js|html|pdf)$"> Header set Cache-Control "max-age=2592000, public, must-revalidate" Header unset ETag FileETag None </FilesMatch> However I read about (and wanted to add) Header unset Last-Modified, so it would be something like: <FilesMatch "\.(flv|gif|jpg|jpeg|png|ico|swf|css|js|html|pdf)$"> Header set Cache-Control "max-age=2592000, public,