Operating System - HP-UX
1838660 Members
14269 Online
110128 Solutions
New Discussion

Re: how large can a specified file grow to?

 
Stan Sieler
Respected Contributor

how large can a specified file grow to?

Hi,

I've just opened a new disk file ... how large can it grow?

At first glance, one would think ulimit,
getrlimit, or getrlimit64 ... but those
report the *process*'s limit on max file size,
not the appropriate file system's limit.

Is there a routine like:

get_file_info (int fid,
int which, // FI_MAX_FILE_SIZE
int64 *result)

which will tell me the max size *the specified
file* can grow to?

Obviously, any such routine *must* take
a filedes or a path as a parameter, otherwise
it would not know which filesystem is
going to impose the limit.

(I googled, but with no success.)

thanks,

Stan
4 REPLIES 4
Robert-Jan Goossens
Honored Contributor

Re: how large can a specified file grow to?

Stan,

Are you looking for the Supported File and File System Sizes for HFS and JFS ?

http://docs.hp.com/en/5971-2383/5971-2383.pdf

Robert-Jan
Stan Sieler
Respected Contributor

Re: how large can a specified file grow to?

Jan asks: Are you looking for the Supported File and File System Sizes for HFS and JFS ?

No...that's not relevant. A given HP-UX
system can have multiple file systems.
I've just opened a new disk file
(implication: I'm writing to it),
and I want to know "what size limit does the
file system that the file resides on
impose on this file?".

Note that the referenced doc lists dozens
of file system / HP-UX release combinations,
further increasing the value of having
a routine to call to get the answer :)

thanks.
Charles McCary
Valued Contributor

Re: how large can a specified file grow to?

Maybe I'm not understanding the question, but isn't the filesize of the file limited by the size of the filesystem?
Stan Sieler
Respected Contributor

Re: how large can a specified file grow to?

Charles asks:
Maybe I'm not understanding the question, but isn't the filesize of the file limited by the size of the filesystem?


To some extent, yes.
But there are a number of factors one must consider:

- does the process have a smaller limit
(see ulimit() and getrlimit / getrlimit64)

If the ulimit (UL_GETFSIZE) is smaller
than the file's file system limit, then
that will apply.

But, I hoped it would be clear that I
wasn't worried about this case, hence
the emphasis on the limit the file system
would impose.

- size of the file system

a. current size

The size of a file system is the
*CURRENT* size. Some file systems
may be dynamically expandable.

Thus, checking the current size
of a file system may not be
an appropriate answer to the
question.

b. for non-expandable filesystems,
how much free disk space is
current available in the file
system?

That, obviously, would encourage
me to expand my desired routine
by having three kinds of info I'd
like to be able to obtain:
FI_GET_MAX_SIZE_IF_FREE_DISK_AVAILABLE
FI_GET_MAX_SIZE_IF_FREE_DISK_AVAILABLE_AND_FILE_SYSTEM_IS_AT_MAX_SIZE
FI_GET_MAX_SIZE_CURRENTLY

:)

c. assuming disk space is not a
constraint, how large is the
file system willing to let the
file be?

I've seen no documents from HP
asserting that for any given
file system, the maximum file
size matches the maximum
*file system* size. E.g., I'd
fully expect to see a file system
capable of supporting many TBs
of space, but possibly limiting
any one file to, say, 1 TB.

Thus, obtaining the answer to
"how big is the file system"
may not answer the original
question. (And, of course, it's
tedious to derive the file system
from an opened file :)

In short, you see that my original question
is still interesting.

thanks.