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

  1. Newsgroups: comp.sys.sgi
  2. Path: sparky!uunet!sun-barr!ames!nsisrv!climate!merritt
  3. From: merritt@climate.NoSubdomain.NoDomain (John H. Merritt)
  4. Subject: Re: Problem with "chdir"
  5. Message-ID: <1992Aug31.172849.22337@nsisrv.gsfc.nasa.gov>
  6. Sender: usenet@nsisrv.gsfc.nasa.gov (Usenet)
  7. Nntp-Posting-Host: climate.gsfc.nasa.gov
  8. Organization: Climate and Radiation Branch
  9. References:  <1992Aug31.161656.1@vaxa.strath.ac.uk>
  10. Date: Mon, 31 Aug 1992 17:28:49 GMT
  11. Lines: 33
  12.  
  13. In article <1992Aug31.161656.1@vaxa.strath.ac.uk>, cbas25@vaxa.strath.ac.uk writes:
  14. |> The following piece of code illustrates an anomaly between
  15. |> IRIX 4.0.x and earlier versions of IRIX.
  16. No. It illustrates a common programming mistake.
  17. You declared 'chdir' as real, implicitly, when it should be integer.
  18.  
  19. |> C-------------------------------cut here------------------------
  20. |>       PROGRAM CHANGEDIR
  21. |> 
  22.          integer chdir
  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. -- 
  38.         \___   \______   \__  \__  \___   \__
  39.         \___  \________  \__  \__  \____  \__
  40.         \___  \__   \__  \__  \__  \_____ \__
  41.         \___  \__   \__  \_______  \__ \__\__   merritt@climate.gsfc.nasa.gov
  42. \___    \___  \__   \__  \_______  \__  \____   
  43. \___    \___  \__   \__  \__  \__  \__   \___   "Yesterday I knew nothing,
  44.  \_________   \_______   \__  \__  \__    \__    Today I know that."
  45.   \______      \_____    \__  \__  \__     \_
  46.