03-25-2014
File shows in ls but cannot be accessed
I can do an ls -l CD* and see the following CDTEST userA RW RW R and I an logged on as userA. But if I do an ls -l the file does not appear. If I do a vi CDTEST it tries to create a new file named CDTEST. If I do a mv or rm I get the message no file of name CDTEST found. Any idea what is going on. This is very goofy. Thank you.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am writing a script that periodically reads in data from a text file. The only issue is that, that text file is periodically updated (appended to) by another script. I am using perl in UNIX environment. How can I check if that text file is being accessed, so I can wait until it is no longer being... (6 Replies)
Discussion started by: rickylui
6 Replies
2. Shell Programming and Scripting
Hi,
I need to count the number of times a script is accessed from within the script. Is it possible ?
Example: I have a script called lo.sh and i execute the script for the first time, then the counter variable declared inside the lo.sh should increment by 1. For every execution the... (1 Reply)
Discussion started by: pathanjalireddy
1 Replies
3. UNIX for Dummies Questions & Answers
how can I use 'ls' to list file which is accessed yesterday? Thx :confused: (2 Replies)
Discussion started by: aaron_fong
2 Replies
4. Shell Programming and Scripting
when unix is logged in it access some login file depending on the shell
like .cshrc , .login , .vimrc , .bashrc
how can we know which is being access in a perticular unix flavor. (1 Reply)
Discussion started by: useless79
1 Replies
5. Shell Programming and Scripting
Hi all,
I will thankful if anybody helps me in finding out the users who accessed any of our files.
Thanks in advance
Chanakya (2 Replies)
Discussion started by: Chanakya.m
2 Replies
6. AIX
Hey,
I want to ask a simple Question....
How would I be able to come to know that files/directoires in a Parent directory has been accessed (means contents of the file has been just viewed) by the user(s) in a group ? and mail the name(s) of those files/directories which has been accessed... (1 Reply)
Discussion started by: varungupta
1 Replies
7. Shell Programming and Scripting
Hey,
I want to ask a simple Question....
How would I be able to come to know that files/directoires in a Parent directory has been accessed (means contents of the file has been just viewed) by the user(s) in a group ? and mail the name(s) of those files/directories which has been accessed... (16 Replies)
Discussion started by: varungupta
16 Replies
8. Shell Programming and Scripting
Hello, is there maybe a way to check if a specific file is being accessed at the moment?
Example:
You will start copying a 10 GB file from A to B, how could I code it so my script actually knows when file B is finished copying? (1 Reply)
Discussion started by: TehOne
1 Replies
9. UNIX for Advanced & Expert Users
Hi All,
is there any command or script to find out last five users who have accessed a file
thanks
jcpratap (1 Reply)
Discussion started by: Jcpratap
1 Replies
10. UNIX for Beginners Questions & Answers
Hi All,,
I need to find the latest files that are accessed less than 10mins in a particular directory & send those files in an attachment.
I could use the below simple one. But if the directory was not updated any recently i could mail the old file again, i need to eliminate that.. What shld... (8 Replies)
Discussion started by: Jeevitha
8 Replies
LEARN ABOUT REDHAT
io::file
IO::File(3pm) Perl Programmers Reference Guide IO::File(3pm)
NAME
IO::File - supply object methods for filehandles
SYNOPSIS
use IO::File;
$fh = new IO::File;
if ($fh->open("< file")) {
print <$fh>;
$fh->close;
}
$fh = new IO::File "> file";
if (defined $fh) {
print $fh "bar
";
$fh->close;
}
$fh = new IO::File "file", "r";
if (defined $fh) {
print <$fh>;
undef $fh; # automatically closes the file
}
$fh = new IO::File "file", O_WRONLY|O_APPEND;
if (defined $fh) {
print $fh "corge
";
$pos = $fh->getpos;
$fh->setpos($pos);
undef $fh; # automatically closes the file
}
autoflush STDOUT 1;
DESCRIPTION
"IO::File" inherits from "IO::Handle" and "IO::Seekable". It extends these classes with methods that are specific to file handles.
CONSTRUCTOR
new ( FILENAME [,MODE [,PERMS]] )
Creates an "IO::File". If it receives any parameters, they are passed to the method "open"; if the open fails, the object is
destroyed. Otherwise, it is returned to the caller.
new_tmpfile
Creates an "IO::File" opened for read/write on a newly created temporary file. On systems where this is possible, the temporary file
is anonymous (i.e. it is unlinked after creation, but held open). If the temporary file cannot be created or opened, the "IO::File"
object is destroyed. Otherwise, it is returned to the caller.
METHODS
open( FILENAME [,MODE [,PERMS]] )
"open" accepts one, two or three parameters. With one parameter, it is just a front end for the built-in "open" function. With two or
three parameters, the first parameter is a filename that may include whitespace or other special characters, and the second parameter
is the open mode, optionally followed by a file permission value.
If "IO::File::open" receives a Perl mode string (">", "+<", etc.) or an ANSI C fopen() mode string ("w", "r+", etc.), it uses the
basic Perl "open" operator (but protects any special characters).
If "IO::File::open" is given a numeric mode, it passes that mode and the optional permissions value to the Perl "sysopen" operator.
The permissions default to 0666.
For convenience, "IO::File" exports the O_XXX constants from the Fcntl module, if this module is available.
SEE ALSO
perlfunc, "I/O Operators" in perlop, IO::Handle IO::Seekable
HISTORY
Derived from FileHandle.pm by Graham Barr <gbarr@pobox.com>.
perl v5.8.0 2002-06-01 IO::File(3pm)