Help Files: Fortran77: Disk Space





     HELP                      June 15, 1985            F77/DISK_SPACE



                       Minimizing Use of Disk Space

     You can save disk space by removing object ('.o') files, and exe-
     cutable  modules  ('a.out'  files), and core dumps ('core' files)
     when they will no longer be used.

     You can use the 'find' command to delete all core dumps  in  your
     account:

             find ~ -name core -exec /bin/rm{} ;

     Find can also be used to remove all '.o' files  not  accessed  in
     the last week:

             find ~ -name '*.o' -atime +7 -exec /bin/rm{} ;

     Change ~ to . to look only in the current directory and its  sub-
     directories.  See "man 1 find" for more information on 'find'.

     If you don't use the debugger, then there is  no  point  in  ever
     saving core dumps in files; to prevent this, add:

             limit coredumpsize 0

     in your .login file.  F77 does not produce dumps unless  you  use
     the  '-g'  flag,  so this mainly eliminates dumps from other pro-
     grams and utilites.  If you do execute this, then you  must  exe-
     cute:

             unlimit coredumpsize

     if you want a dump with f77.

     You can reduce the size of modules by stripping them:

             strip a.out

     This typically saves 20-40% of the file size.  Use the strip com-
     mand  only  on  executable  modules  (a.out files), not on object
     ('.o') files.  You can not use the  debugger  after  stripping  a
     module.

     It is possible with other commands to strip  local  symbols  from
     '.o'  files;  this is worthwhile mainly for libraries.  See "help
     f77 biglibs" for details.


     Put temporary files in the directory /tmp.  E.g.:

             a.out > /tmp/myoutput

     Although files in /tmp may disappear at any  time,  they  usually
     last through the day.  If you use /tmp, then your temporary files
     will disappear even if you forget about them.

     The following commands will strip off the  sequence  field  (cols
     73-80)  and any trailing blanks from all the .f files in a direc-
     tory:

             foreach i ( *.f )
               colrm 73 < $i   |    sed -e 's/  *$//' > tmp
               /bin/mv tmp $i
             end

     Note there are two blanks before the asterisk in the sed command.

     In rare circumstances, when tabs are used  before  the  statement
     body  field  and the line contains part of a Hollerith, stripping
     trailing blanks is unsafe.  See "help f77 source" for an example.

             


Comments to decf@euler.berkeley.edu
© 1998 UC Regents