home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.23 / text0024.txt < prev    next >
Encoding:
Text File  |  1991-06-15  |  1.4 KB  |  36 lines

  1. Submitted-by: willcox@urbana.mcd.mot.com (David A Willcox)
  2.  
  3. >Would someone who knows please tell me the relationship between the
  4. >Standard C macro FILENAME_MAX and the POSIX macro _POSIX_PATH_MAX.
  5.  
  6. Since FILENAME_MAX is the longest possible filename string that can be
  7. passed to fopen() and the like, it should be a value no smaller than
  8. the largest possible value for PATH_MAX on your system.  It mustn't
  9. ever be smaller than _POSIX_PATH_MAX, and would only be that small on
  10. an implementation that only supported the minimum value for PATH_MAX
  11. required by POSIX.
  12.  
  13. To quote from the C standard, FILENAME_MAX:
  14.  
  15.     ... expands to an integral constant expression that is the size needed
  16.     for an array of char large enough to hold the longest file name
  17.     string that the implementation guarantees can be opened. [There's
  18.     a footnote saying that this doesn't mean that just any string this
  19.     long is a valid file name.]
  20.  
  21. Since the C standard does not have any concept of directories, "file
  22. name" in this context clearly corresponds to a POSIX path, not an
  23. individual file name.
  24.  
  25. (Standard disclaimer stuff.  Motorola and POSIX disavow all knowledge of
  26. my actions.)
  27.  
  28. David A. Willcox        "Just say 'NO' to universal drug testing"
  29. Motorola MCD - Urbana        UUCP: ...!uiucuxc!udc!willcox
  30. 1101 E. University Ave.        INET: willcox@urbana.mcd.mot.com
  31. Urbana, IL 61801        FONE: 217-384-8534
  32.  
  33.  
  34. Volume-Number: Volume 23, Number 25
  35.  
  36.