07-11-2008
Touch is a built in UNIX command.
To call it from within a C program, you have to use "system" function
system ("/usr/bin/touch /path/file-name") ;
Syntax of Touch:
touch [-acm] [-t [[CC]YY]MMDDhhmm[.SS]] file...
Please see the man page for touch for more details.
To answer if you can modify the time stamp on an NFS mounted File: It depends on your access permission. If you are able to write to that file over NFS, yes, you can change the access time.
-GGR
10 More Discussions You Might Find Interesting
1. Linux
hi
i am wondering if it is possible to use one nfs mount point for several logical volumes.
i have a top level directory /imaging with data1 - data50 below it. each dataX directory is a logical volume configured through LVM. if i mount them separately on the client (i.e. 50 lines in fstab... (1 Reply)
Discussion started by: user23
1 Replies
2. AIX
Hi,
I'm looking to create a NFS mount point monitoring shell script not sure if im going the right way about it so could do with some help. What i was thinking of doing was using the below command but am unsure how to handle the output. So if the filesyetem is active it will return "1" but if... (4 Replies)
Discussion started by: elmesy
4 Replies
3. Red Hat
Hi Forum
I am trying to mount /NFS as nfs mountpoint on two servers ( A & B ).
After mounting the nfs filesystem, both of them behave normally for around 10 mins and after that the NFS file handle become stale and the
mountpoints dont respond. While executing df -kh, the output hang out and the... (15 Replies)
Discussion started by: rajdasuwal
15 Replies
4. Solaris
hi all
i have mounted one nfs mount point but i has no write permission on it.
when i am going to make a directory it is giving an error
# mkdir 1
mkdir: Failed to make directory "1"; Permission denied
i shared using command
# share -F nfs -o rw -d "backup" /backup
mounted using... (3 Replies)
Discussion started by: nikhil kasar
3 Replies
5. Shell Programming and Scripting
Hi ,
i have create the bash script for nfs but in this script asking for mount point only once it is it prompting for second time.
example: do you wants to create any other mount point ?
note(if i give yes it should ask me to add the mount point else it should proceed with next step) it... (5 Replies)
Discussion started by: Rahulne25
5 Replies
6. Shell Programming and Scripting
Explain it with proper e.g (4 Replies)
Discussion started by: sidpatil
4 Replies
7. Red Hat
Hi,
Can you tell me something about NFS mount point ?
Regards,
Maddy (3 Replies)
Discussion started by: Maddy123
3 Replies
8. Red Hat
Dear All,
We have two different mount points in Linux NFS one is 15 TB and another one is 15 TB.
Can we club both of the two mount points and club in to a single volume in Linux.
As we need to restore Database in that single volume.
Kindly help us on this.
Regards ,
rj (10 Replies)
Discussion started by: jegaraman
10 Replies
9. AIX
I have situation where my disk upon reboot, has its mount point as #
LOGICAL VOLUME: disk4vol VOLUME GROUP: disk4vg
LV IDENTIFIER: 00f609aa00004c0000000152414b786c.1 PERMISSION: read/write
VG STATE: active/complete LV STATE: closed/syncd
TYPE: jfs2 WRITE VERIFY: off
MAX LPs: 512 PP SIZE: 512... (1 Reply)
Discussion started by: mrmurdock
1 Replies
10. Solaris
Something has changed.....
/etc/vfstab entry:-
host1:/backup/RMAN - /RMAN nfs - no rw,hard,rsize=32768,wsize=32768,llockBut when I mount it, and run
df -k | grep RMANResults are:-
host1:/backup/RMAN 54971960832 26752241664 28219719168 49% ... (1 Reply)
Discussion started by: psychocandy
1 Replies
LEARN ABOUT DEBIAN
file::touch
Touch(3pm) User Contributed Perl Documentation Touch(3pm)
NAME
File::Touch - update access and modification timestamps, creating nonexistent files where necessary.
SYNOPSIS
use File::Touch;
@file_list = ('one.txt','../two.doc');
$count = touch(@file_list);
use File::Touch;
$reference_file = '/etc/passwd';
$touch_obj = File::Touch->new(
reference => $reference_file,
no_create => 1
);
@file_list = ('one.txt','../two.doc');
$count = $touch_obj->touch(@file_list);
DESCRIPTION
Here's a list of arguments that can be used with the object-oriented contruction:
atime_only => [0|1]
If nonzero, change only the access time of files. Default is zero.
mtime_only => [0|1]
If nonzero, change only the modification time of files. Default is zero.
no_create => [0|1]
If nonzero, do not create new files. Default is zero.
reference => $reference_file
If defined, use timestamps from this file instead of current time. Default is undefined.
atime => $time
If defined, use this time (in epoch seconds) instead of current time for access time.
mtime => $time
If defined, use this time (in epoch seconds) instead of current time for modification time.
Examples
Update access and modification times, creating nonexistent files
use File::Touch;
my @files = ('one','two','three');
my $count = touch(@files);
print "$count files updated
";
Set access time forward, leave modification time unchanged
use File::Touch;
my @files = ('one','two','three');
my $day = 24*60*60;
my $time = time() + 30 * $day;
my $ref = File::Touch->new( atime_only => 1, time => $time );
my $count = $ref->touch(@files);
print "$count files updated
";
Set modification time back, update access time, do not create nonexistent files
use File::Touch;
my @files = ('one','two','three');
my $day = 24*60*60;
my $time = time() - 30 * $day;
my $ref = File::Touch->new( mtime => $time, no_create => 1 );
my $count = $ref->touch(@files);
print "$count files updated
";
AUTHOR
Nigel Wetters Gourlay (nwetters@cpan.org)
COPYRIGHT
Copyright (c) 2001,2007,2009 Nigel Wetters Gourlay. All Rights Reserved. This module is free software. It may be used, redistributed
and/or modified under the same terms as Perl itself.
perl v5.10.0 2009-07-25 Touch(3pm)