09-22-2008
There's a separate API for file sizes.
size_t I believe is meant for sizes of in-memory structures. ftell(3) for example returns a long. lseek(3) returns an
off_t. See further <sys/types.h> documentation e.g.
<sys/types.h>
The idea that files could not be larger than a particular offset is a source of many bugs and growing pains. Some older file systems could not cope with large files, which back then meant bigger than 2GB or 4GB. We are beginning to see this again as storage capacities are approaching the next boundary. It's the good old "640kb ought to be enough for everybody" syndrome.
9 More Discussions You Might Find Interesting
1. Programming
#include <stdio.h>
void main()
{
int Index=1;
char *Type=NULL;
Type = (char *)Index;
printf("%s",Type);
}
Getting coredump (5 Replies)
Discussion started by: vijaysabari
5 Replies
2. Programming
What is the difference between int** func() and int*& func(). Can you please explain it with suitable example.
Thanks,
Devesh. (1 Reply)
Discussion started by: devesh
1 Replies
3. Programming
Is there any way to know the filename from an available file pointer. (2 Replies)
Discussion started by: bankpro
2 Replies
4. AIX
Hi All,
I have Network color laser printer which is to be configured in AIX5L.
The Model of the printer is OKI C3200.
Will it is supported with AIX 5..? I could not find any drivers for this.
Will any compatible drivers are available for this printer... I tried with the default drivers hplj-4... (2 Replies)
Discussion started by: helloajith
2 Replies
5. UNIX for Dummies Questions & Answers
hello everybody!
I want to create a file with permissions for read, write, and execute to everybody using C, so I write this code:
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(){
int fileDescriptor;
fileDescriptor =... (2 Replies)
Discussion started by: csnmgeek
2 Replies
6. Programming
Hi,
from the manual
listen(2): listen for connections on socket - Linux man page
It has a parameter called backlog and it limits the maximum length of queue of pending list.
If I set backlog to 128, is it means no more than 128 packets can be handled by server?
If I have three... (3 Replies)
Discussion started by: sehang
3 Replies
7. Programming
int air_date='20100103'; //2010 - Jan - 03
/* My goal here is to subtract a day. */
int day = air_date % 100; //?????? Is this right?
//Are there any functions time/date for this type of date format?
:cool: (7 Replies)
Discussion started by: sepoto
7 Replies
8. Solaris
Hi I am getting the below error
/bin/mkdir -p ./obj/SunOS10_32/SingleThread/Debug/CC_5_3
/bin/mkdir -p ./bin/SunOS10_32/SingleThread/Debug/CC_5_3
CC -c -ptr./obj/SunOS10_32/SingleThread/Debug/CC_5_3 -V -I/opt/tuxedo/tuxedo11gR1/include -I. -I../../OBED_SA_1-27a/include... (1 Reply)
Discussion started by: deboprio
1 Replies
9. Solaris
Hi guys,
I am currently receiving the following output in /var/log/syslog and is occurring every second leading to /var directory being full after every 2 days.
Aug 20 17:32:29 opaldn1 sendmail: r7KCOlQm002517: ruleset=check_rcpt, arg1=<postmaster@silverapp6>, relay=, reject=450 4.4.0... (3 Replies)
Discussion started by: Junaid Subhani
3 Replies
FTELL(3P) POSIX Programmer's Manual FTELL(3P)
PROLOG
This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the correspond-
ing Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.
NAME
ftell, ftello -- return a file offset in a stream
SYNOPSIS
#include <stdio.h>
long ftell(FILE *stream);
off_t ftello(FILE *stream);
DESCRIPTION
The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here
and the ISO C standard is unintentional. This volume of POSIX.1-2008 defers to the ISO C standard.
The ftell() function shall obtain the current value of the file-position indicator for the stream pointed to by stream.
The ftell() function shall not change the setting of errno if successful.
The ftello() function shall be equivalent to ftell(), except that the return value is of type off_t and the ftello() function may change
the setting of errno if successful.
RETURN VALUE
Upon successful completion, ftell() and ftello() shall return the current value of the file-position indicator for the stream measured in
bytes from the beginning of the file.
Otherwise, ftell() and ftello() shall return -1, and set errno to indicate the error.
ERRORS
The ftell() and ftello() functions shall fail if:
EBADF The file descriptor underlying stream is not an open file descriptor.
EOVERFLOW
For ftell(), the current file offset cannot be represented correctly in an object of type long.
EOVERFLOW
For ftello(), the current file offset cannot be represented correctly in an object of type off_t.
ESPIPE The file descriptor underlying stream is associated with a pipe, FIFO, or socket.
The following sections are informative.
EXAMPLES
None.
APPLICATION USAGE
None.
RATIONALE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
Section 2.5, Standard I/O Streams, fgetpos(), fopen(), fseek(), lseek()
The Base Definitions volume of POSIX.1-2008, <stdio.h>
COPYRIGHT
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1, 2013 Edition, Standard for Information Technol-
ogy -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, Copyright (C) 2013 by the Institute of
Electrical and Electronics Engineers, Inc and The Open Group. (This is POSIX.1-2008 with the 2013 Technical Corrigendum 1 applied.) In the
event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Stan-
dard is the referee document. The original Standard can be obtained online at http://www.unix.org/online.html .
Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source
files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
IEEE
/The Open Group 2013 FTELL(3P)