ulimit

hi

what is the difference between file and data? if file is unlimited, does that mean we can have a file as big as we like?

thanks.

file(blocks) unlimited
data(kbytes) 1048576

data is the size of the data segment of a process. This is similiar to stack which is a limit on the stack segment of a process. file is the limit of a data file on disk (or more generally, a file in a filesystem).

unlimited means that the ulimit facility imposes no artificial limit of its own. But everything in a computer is finite. Eventually you will bump into some other limit.

thanks a lot

There are two limits on files - the total number of files you can have open at one time, and the max size of a file. The number of open files depends on things like kernel settings and your OS. The max size of a file usually depends on whether your system can support files larger than 2GB. Of course you have to have free disk space.....

thanks jim,

i jabe heard this before, of a file not being able to be bigger than 2G. Is this because this is the default? If my ulimit for file is set to say 10G, then can I create a file bigger than 2G? Or are there some other programs that also have limits set to 2G, so even if I created it for 5G on my unix box, it might still give me some problems?

thanks

There are various file system types that have inherent limits. cdrfs jfs jfs2 etc. So as you build a unix system you need to be aware of the limitations of the various filesystem types. Each of them will have upper limits on inode numbers file sizes etc.

Files bigger than the number of bytes that a 32 bit integer can reference are usually called largefiles. Most modern UNIX-es have support for it with either oddly-named non-standard calls like fopen64() or some kind of more modern filesystem.

If you have LARGEFILE support and no disk quota enabled, you can essentially create a file that has size equal to the free space available on the disk. This is a BAD idea in general. sysadmins love to hate giant files, especially small files with giant holes in them....