home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / sgi / 13079 < prev    next >
Encoding:
Text File  |  1992-08-31  |  1.5 KB  |  45 lines

  1. Newsgroups: comp.sys.sgi
  2. Path: sparky!uunet!pipex!warwick!str-ccsun!str-va!cbas25
  3. From: cbas25@vaxa.strath.ac.uk
  4. Subject: Problem with "chdir"
  5. Message-ID: <1992Aug31.161656.1@vaxa.strath.ac.uk>
  6. Lines: 33
  7. Sender: news@ccsun.strath.ac.uk (News account )
  8. Nntp-Posting-Host: vaxe
  9. Organization: Strathclyde University VAX Cluster
  10. Date: Mon, 31 Aug 1992 16:16:56 GMT
  11.  
  12. The following piece of code illustrates an anomaly between
  13. IRIX 4.0.x and earlier versions of IRIX.
  14. With 4.0.0 and  4.0.5  the second and third write
  15. statements always print zero, wheras the second should be -1
  16. and the third should be zero (unless you are in root directory!)
  17. I seem to remember that --chdir--  worked correctly in 3.3.1, but I have
  18. converted both my machines to 4.0.1 and 4.0.5 and so cannot
  19. verify this now. 
  20. Compiled on Personal Iris 4D-20  
  21. C-------------------------------cut here------------------------
  22.       PROGRAM CHANGEDIR
  23.  
  24. C  To test the fortran subroutine chdir
  25.       I = 999
  26.       write (*,*) I
  27.       I = chdir ('notthere')    !  This directory is not there
  28.       write (*,*) I             !  Should return -1
  29.       call system ('pwd')       !  No change in directory
  30.       I = chdir ('..')          !  Go to parent directory 
  31.       write (*,*) I             !  Should return 0
  32.       call system ('pwd')       !  Should now be parent directory
  33.       stop
  34.       end
  35. C-------------------------------cut here------------------------
  36.  
  37. Peter Bladon
  38. Department of Pure and Applied Chemistry
  39. University of Strathclyde
  40. Glasgow G1 1XL
  41. Scotland
  42.  
  43. e-mail  cbas25%vaxa.strath.ac.uk
  44.  
  45.