home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / os2 / programm / 6274 < prev    next >
Encoding:
Text File  |  1992-11-08  |  1.7 KB  |  67 lines

  1. Newsgroups: comp.os.os2.programmer
  2. Path: sparky!uunet!stanford.edu!CSD-NewsHost.Stanford.EDU!Xenon.Stanford.EDU!loekken
  3. From: loekken@Xenon.Stanford.EDU (Jack Viktor Loekken)
  4. Subject: gcc (emx version) and long filenames.
  5. Message-ID: <1992Nov8.045519.17076@CSD-NewsHost.Stanford.EDU>
  6. Sender: news@CSD-NewsHost.Stanford.EDU
  7. Organization: Computer Science Department, Stanford University.
  8. Date: Sun, 8 Nov 1992 04:55:19 GMT
  9. Lines: 56
  10.  
  11. I am having trouble with gcc (emx version) and long filenames on
  12. HPFS partition.
  13.  
  14. example :
  15.  
  16. #include <stdio.h>
  17.  
  18. void main()
  19. {
  20. FILE *f1,*f2,*f3,*f4;
  21.  
  22.     f1 = fopen ("this.file.already.exists","rb");
  23.     f2 = fopen ("this_file_also_exists","rb");
  24.     
  25.     f3 = fopen ("this.file.should.be.created","wb");
  26.     f4 = fopen ("so_should_this_file","wb");
  27.  
  28.     if (!f1)
  29.       printf ("\nUnable to open <this.file.already.exists>");
  30.  
  31.     if (!f2)
  32.       printf ("\nUnable to open <this_file_also_exists>");
  33.  
  34.     if (!f3)
  35.       printf ("\nUnable to create <this.file.should.be.created>");
  36.  
  37.     if (!f4)
  38.       printf ("\nUnable to create <so_should_this_file>");
  39.  
  40.     /** do some processing **/
  41.     fcloseall();
  42. }
  43.  
  44. The program prints out : 
  45.  
  46.     Unable to open <this.file.already.exists>
  47.  
  48. even (as the filename implies) it does exist. Also, instead
  49. of creating the file 'this.file.should.be.created', it creates the
  50. file 'this.fil.sho.be.cre'. The filenames that did not contain periods
  51. were handled correctly.
  52.  
  53. The program was compiled with the command line :
  54.  
  55. gcc -o test.exe test.c
  56.  
  57. Then I tried the following compile commandline :
  58.  
  59. gcc -o test.exe test.c /emx/lib/io/open.c /emx/lib/sys/seterrno.c -los2
  60.  
  61. This time the program behaved correctly. Can anybody explain this ?
  62. I assume that the I/O functions resides in the dll's, but I haven't
  63. found out how to rebuild these. Anybody knows ?
  64.  
  65. Jack
  66.  
  67.