04-30-2015
If you'd been deleting files which happened to still be open, they won't be truly removed from disk until whatever had them open, closes them. This is a common trap new administrators fall into.
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
How I can call routines for write large files' text if I've a libraries that can't be compiled in 64 bits? I tried whit open O_LARGEFILE option but if I see the rows whith cat are strange because I only see the first one. (1 Reply)
Discussion started by: glfuentes
1 Replies
2. UNIX for Dummies Questions & Answers
I am trying to understand the webserver log file for an error which has occured on my live web site.
The webserver access file is very big in size so it's not possible to open this file using vi editor. I know the approximate time the error occured, so i am interested in looking for the log file... (4 Replies)
Discussion started by: sehgalniraj
4 Replies
3. UNIX for Dummies Questions & Answers
How do we check 'large files' is enabled on a Unix box -- HP-UX B11.11 (2 Replies)
Discussion started by: ranj@chn
2 Replies
4. UNIX for Dummies Questions & Answers
I'm looking to display the largest files in a file system without descending into subdirectories.
The / file system is 65% full and I'm looking to display only the files in / without taking into
consideration other filesystem/directories.
I can execute this command
du -sk ./* |sort -nr... (2 Replies)
Discussion started by: Steelysteel
2 Replies
5. UNIX for Dummies Questions & Answers
When I have a file for example with the wrong name I normally use the cp {filename} {new filename} comand so I will have the original as well as the correct named file. Just for backup purposes.
Problem: I have a file that is 24gb with a case sensitive filename. The file was named with upper... (3 Replies)
Discussion started by: trek88
3 Replies
6. Shell Programming and Scripting
Hello everyone!
I have 2 types of files in the following format:
1) *.fa
>1234
...some text...
>2345
...some text...
>3456
...some text...
.
.
.
.
2) *.info
>1234 (7 Replies)
Discussion started by: ad23
7 Replies
7. Solaris
Hello everyone. Need some help copying a filesystem. The situation is this: I have an oracle DB mounted on /u01 and need to copy it to /u02. /u01 is 500 Gb and /u02 is 300 Gb. The size used on /u01 is 187 Gb. This is running on solaris 9 and both filesystems are UFS.
I have tried to do it using:... (14 Replies)
Discussion started by: dragonov7
14 Replies
8. UNIX for Dummies Questions & Answers
hi guys
I have suse 11 sp1 and I have a lot of warn file filling / these are under /var/log
there's this big one
-rw-r----- 1 root root 3.9G Feb 1 10:28 warn
warn: ASCII text
and the others that are about 2.5 to 3MB - they are about 130 warn-*.bz2
-rw-r----- 1 root root 3.9G Feb... (2 Replies)
Discussion started by: karlochacon
2 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have to text files that I want to merge by the first column. The values in the first column pretty much match for the first part. However there are some values that are present in column 1 and not present in column 2 or vice versa. For such values I would like to substitute X for the... (9 Replies)
Discussion started by: evelibertine
9 Replies
CLOSE(2) Linux Programmer's Manual CLOSE(2)
NAME
close - close a file descriptor
SYNOPSIS
#include <unistd.h>
int close(int fd);
DESCRIPTION
close closes a file descriptor, so that it no longer refers to any file and may be reused. Any locks held on the file it was associated
with, and owned by the process, are removed (regardless of the file descriptor that was used to obtain the lock).
If fd is the last copy of a particular file descriptor the resources associated with it are freed; if the descriptor was the last reference
to a file which has been removed using unlink(2) the file is deleted.
RETURN VALUE
close returns zero on success, or -1 if an error occurred.
ERRORS
EBADF fd isn't a valid open file descriptor.
EINTR The close() call was interrupted by a signal.
EIO An I/O error occurred.
CONFORMING TO
SVr4, SVID, POSIX, X/OPEN, BSD 4.3. SVr4 documents an additional ENOLINK error condition.
NOTES
Not checking the return value of close is a common but nevertheless serious programming error. It is quite possible that errors on a pre-
vious write(2) operation are first reported at the final close. Not checking the return value when closing the file may lead to silent
loss of data. This can especially be observed with NFS and disk quotas.
A successful close does not guarantee that the data has been successfully saved to disk, as the kernel defers writes. It is not common for
a filesystem to flush the buffers when the stream is closed. If you need to be sure that the data is physically stored use fsync(2). (It
will depend on the disk hardware at this point.)
SEE ALSO
open(2), fcntl(2), shutdown(2), unlink(2), fclose(3), fsync(2)
2001-12-13 CLOSE(2)