X-Spam-Check-By: sourceware.org Date: Sun, 30 Jul 2006 15:42:29 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: 1.5.21: file timestamp not updated after editing Message-ID: <20060730134229.GD8152@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <89b7ca960607291929u28fd2020kcc0dc399dbf9d5e1 AT mail DOT gmail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <89b7ca960607291929u28fd2020kcc0dc399dbf9d5e1@mail.gmail.com> User-Agent: Mutt/1.4.2i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Jul 29 19:29, Alex Eng wrote: > After editing a file, the timestamp on the file (according to ls -l) > is unchanged. However if stat is executed, the change > timestamp given in the output differs from that given in ls -l: > > $ ls -l foo.c > -rw-r--r-- 1 Alex 126 Jul 29 17:10 foo.c > $ nano foo.c > ### File is edited and saved ### > $ ls -l foo.c > -rw-r--r-- 1 Alex 289 Jul 29 17:10 foo.c > $ stat foo.c > File: `foo.c' > Size: 289 Blocks: 1 IO Block: 1024 regular file > Device: a8dc98beh/2833029310d Inode: 562949953426654 Links: 1 > Access: (0644/-rw-r--r--) Uid: ( 1004/ Alex) Gid: ( 513/ None) > Access: 2006-07-29 18:19:09.921875000 -0700 > Modify: 2006-07-29 17:10:44.531250000 -0700 > Change: 2006-07-29 18:19:15.828125000 -0700 I can't reproduce this problem at all. Assuming nano changes the file in place, opposed to editors like vim, which recreate the file on write, then a simple open/write/close like this: #include #include #include int main (int argc, char **argv) { int fd = open (argv[1], O_WRONLY); if (fd < 0) { fprintf (stderr, "open(%s): %d <%s>\n", argv[1], errno, strerror (errno)); return 1; } --argc; ++argv; while (--argc > 0) { ++argv; write (fd, *argv, strlen (*argv)); } close (fd); return 0; } would have the same effect. It hasn't, at least not in my testing. Is there a chance that you're suffering from a malice virus scanner? Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/