Sponsored Content
Full Discussion: File last modified
Top Forums Programming File last modified Post 41783 by Perderabo on Tuesday 14th of October 2003 11:22:01 AM
Old 10-14-2003
I'm not sure what that gibberish is. Some sort of scripting language based on c++?

But try using st_mtime instead of st_ctime.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How do I get the last modified date of a file?

I am trying to load a group of files and their last dates modified into a text file that will in turn be used with SQL*Loader to load these files into Oracle. I am using a *.ksh script. I am getting the name of the file in by using the following: for file_ext in 'cat loaddir.ext'; do find... (2 Replies)
Discussion started by: akpopa
2 Replies

2. UNIX for Dummies Questions & Answers

who modified my file!!

Hi EVERYONE!!... Just a simple (yet critical from my perspective) doubt... I would like to know who had edited my file.. when I use ls -l command, I see my ID.. but when I edit using some other ID, I had expected that ID to be shown.. but still ls -l shows my ID only.. So, is there any... (4 Replies)
Discussion started by: mohanprabu
4 Replies

3. UNIX for Dummies Questions & Answers

how to retrieve original contents of a modified file (modified using vi)

Made changes to a file using vi editor and saved those changes now realised that the changes are not required How can I get the previous version of the file.i.e the one which was there on which I had made changes (3 Replies)
Discussion started by: novice100
3 Replies

4. UNIX for Dummies Questions & Answers

Delete the last modified file

Hi All, I have the following script to delete the last modified file in a directory. #!/bin/ksh if file in $(ls -t /home/KOP/Purge | head -1) then rm -f $file fi But I keep getting the error 0653-901 Cannot get file status Any suggestions or comments as to where I'm getting... (1 Reply)
Discussion started by: kingofprussia
1 Replies

5. Shell Programming and Scripting

Last modified file in 2 or more directories

Hi, Is there any simple way to get the last modified file in a set of 2 or more directories? This should return one file only (not 1 file per directory) Thanks for your help (4 Replies)
Discussion started by: m69w
4 Replies

6. Shell Programming and Scripting

How many days since a file was modified?

I am trying to write a script to backup my laptop to a NAS drive using rsync. I want the backup to be done, only if it has been more than a week since my last backup. Each time the rsync command executes, I also create a file backuptime.txt file, with the time at which the script completed the... (1 Reply)
Discussion started by: anandjayaraman
1 Replies

7. Shell Programming and Scripting

How to get a filename modified by attaching modified timestamp

Hi, I want to modify a filename in AIX by attaching the last modified timestamp. I want the timestamp completely in numerical format (eg:200905081210. yr-2009, mnth - 05, date -08, hr - 12, mins - 10). For example if the filename is a.log and it was modified on April 6th 2008 at 21.00. I... (16 Replies)
Discussion started by: Ruks
16 Replies

8. Shell Programming and Scripting

changing a file when the inode modified time of the other file changes

i have a requirement where i needed to change variable values in a properties file(first file) whenever there is change to Release details file(second file). My question is do i have to create a daemon process that always checks the modified time/inode change of the second file and then change the... (1 Reply)
Discussion started by: saikiran_1984
1 Replies

9. Shell Programming and Scripting

Script to check for the file existence, if file exists it should echo the no of modified days

Hi, I am looking for a shell script with the following. 1. It should check whether a particular file exists in a location #!/bin/sh if ; then echo "xxx.txt File Exists" else echo "File Not Found" fi 2. If file exists, it should check for the modified date and run a command... (2 Replies)
Discussion started by: karthikeyan_mac
2 Replies

10. Shell Programming and Scripting

How to find a file modified more than once

Hi All, How to find a file modified more than once.... Thanks in advance (2 Replies)
Discussion started by: kmsekhar
2 Replies
fclose(3)						     Library Functions Manual							 fclose(3)

NAME
fclose, fflush, fclose_unlocked, fflush_unlocked - Closes or flushes a stream LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <stdio.h> int fclose ( FILE *stream); int fclose_unlocked( FILE *stream); int fflush( FILE *stream); int fflush_unlocked( FILE *stream); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: fclose(), fflush(): XSH5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies the output or update stream. DESCRIPTION
The fclose() function writes buffered data to the stream specified by the stream parameter, and then closes the associated file. The func- tion is automatically called for all open files when the exit() function is invoked. Any unwritten buffered data for the stream is deliv- ered to the host environment to be written to the file; any unread buffered data is discarded. The stream is disassociated from the file. If the associated buffer was automatically allocated, it is deallocated. Any further use of the stream specified by the stream parameter causes undefined behavior. The fclose() function performs the close() function on the file descriptor associated with the stream parameter. If the stream was writable and buffered data was not yet written to the file, it marks the st_ctime and st_mtime fields of the underlying file for update. The fflush() function writes any buffered data for the stream specified by the stream parameter and leaves the stream open. If stream is a null pointer, the fflush() function performs this flushing action on all streams for which the behavior was previously defined. The st_ctime and st_mtime fields of the underlying file are marked for update. [Tru64 UNIX] The fclose_unlocked() and fflush_unlocked() functions are functionally identical to the fclose() and fflush() functions, except that fclose_unlocked() and fflush_unlocked() may be safely used only within a scope that is protected by the flockfile() and fun- lockfile() functions used as a pair. The caller must ensure that the stream is locked before these functions are used. RETURN VALUES
Upon successful completion, the fclose(), fflush(), fclose_unlocked(), and fflush_unlocked() functions return a value of 0 (zero). Other- wise, EOF is returned, and errno is set to indicate the error. ERRORS
The fclose(), fflush(), fclose_unlocked(), and fflush_unlocked() functions set errno to the specified value for following conditions: The O_NONBLOCK flag is set for the file descriptor underlying the stream parameter and the process would be delayed in the write operation. The file descriptor underlying the stream parameter is not valid. An attempt was made to write a file that exceeds the process's file size limit or the maximum file size. (See the ulimit(3) reference page). The file is a regular file and an attempt was made to write at or beyond the offset maximum associated with the corresponding stream. The function was interrupted by a signal that was caught. The TOSTOP tty local mode causes a background process to get a SIGTTOU signal if it attempts to write to the controlling terminal. The SIGTTOU signal, if it is not caught or ignored, will cause the process to block in a stopped state. A process in an orphaned process group is not allowed to become stopped, since there is no unprivileged process to unblock it. This condition only applies to operations on stdio streams associated with ttys. [EIO] is also associated with driver errors. There was no free space remaining on the device containing the file. An attempt was made to write to a pipe or FIFO that is not open for reading by any process. A SIGPIPE signal will also be sent to the process. A request was made of a nonexistent device or the request was outside the capabilities of the device. RELATED INFORMATION
Functions: close(2), exit(2), fopen(3), setbuf(3) Standards: standards(5) delim off fclose(3)
All times are GMT -4. The time now is 02:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy