home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.sgi
- Path: sparky!uunet!sun-barr!ames!nsisrv!climate!merritt
- From: merritt@climate.NoSubdomain.NoDomain (John H. Merritt)
- Subject: Re: Problem with "chdir"
- Message-ID: <1992Aug31.172849.22337@nsisrv.gsfc.nasa.gov>
- Sender: usenet@nsisrv.gsfc.nasa.gov (Usenet)
- Nntp-Posting-Host: climate.gsfc.nasa.gov
- Organization: Climate and Radiation Branch
- References: <1992Aug31.161656.1@vaxa.strath.ac.uk>
- Date: Mon, 31 Aug 1992 17:28:49 GMT
- Lines: 33
-
- In article <1992Aug31.161656.1@vaxa.strath.ac.uk>, cbas25@vaxa.strath.ac.uk writes:
- |> The following piece of code illustrates an anomaly between
- |> IRIX 4.0.x and earlier versions of IRIX.
- No. It illustrates a common programming mistake.
- You declared 'chdir' as real, implicitly, when it should be integer.
-
- |> C-------------------------------cut here------------------------
- |> PROGRAM CHANGEDIR
- |>
- integer chdir
-
- |> C To test the fortran subroutine chdir
- |> I = 999
- |> write (*,*) I
- |> I = chdir ('notthere') ! This directory is not there
- |> write (*,*) I ! Should return -1
- |> call system ('pwd') ! No change in directory
- |> I = chdir ('..') ! Go to parent directory
- |> write (*,*) I ! Should return 0
- |> call system ('pwd') ! Should now be parent directory
- |> stop
- |> end
- |> C-------------------------------cut here------------------------
-
- --
- \___ \______ \__ \__ \___ \__
- \___ \________ \__ \__ \____ \__
- \___ \__ \__ \__ \__ \_____ \__
- \___ \__ \__ \_______ \__ \__\__ merritt@climate.gsfc.nasa.gov
- \___ \___ \__ \__ \_______ \__ \____
- \___ \___ \__ \__ \__ \__ \__ \___ "Yesterday I knew nothing,
- \_________ \_______ \__ \__ \__ \__ Today I know that."
- \______ \_____ \__ \__ \__ \_
-