Subject: Re: Limits?
From: Jan Kellmer <[email-masked]>
To: Elias Biris <[email-masked]>
Cc: [email-masked]
Date: Tue, 05 Feb 2002 16:54:48 +0100

Hello!

Elias Biris wrote:
> 
> Hi all,
> 
> I'd like to ask where can I find information about the types of limits that are set in cygwin utilities for win2k? I am looking specifically for:
> 
> Maximum number of characters that by default can be used in a pathname
> Maximum number of characters that by default can be used in a filename (together with its path)
> Maximum number of characters that by default can be used in a command or commands that can be called by 'exec'
> 
> Sorry for the wide distribution but I could not find this for Cygwin specifically. All information will be gratefully appreciated.
> 

Try this little program:
-- snip -- snap --
#include <limits.h>
#include <stdio.h>
#include <unistd.h>

int main(int argc, char** argv) {
        printf("Max pathname: '%d'\n",
               sysconf(_PC_PATH_MAX));
        printf("Max filename: '%d'\n",
               sysconf(_PC_NAME_MAX));
        printf("Max arguments: '%d'\n",
               sysconf(_SC_ARG_MAX));
}
-- snap -- snip --

The first line of output shows the guaranteed number of characters in a
relative path; the second line shows the guaranteed number of characters
in a filename alone (not preceeded by any path) (both may be limited by
the filesystem on which a file is located; have a look at fpathconf()
and pathconf() also); the third line shows the maximum number of
characters in the argument of an exec() call.

There is no manual page for sysconf() in my cygwin install, but on every
average unix box there is.

Regards,
    Jan

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/