diff options
author | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
---|---|---|
committer | Joe Hunkeler <jhunkeler@gmail.com> | 2015-08-11 16:51:37 -0400 |
commit | 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 (patch) | |
tree | 4464880c571602d54f6ae114729bf62a89518057 /sys/fmio/fmrebuild.x | |
download | iraf-osx-40e5a5811c6ffce9b0974e93cdd927cbcf60c157.tar.gz |
Repatch (from linux) of OSX IRAF
Diffstat (limited to 'sys/fmio/fmrebuild.x')
-rw-r--r-- | sys/fmio/fmrebuild.x | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sys/fmio/fmrebuild.x b/sys/fmio/fmrebuild.x new file mode 100644 index 00000000..9eb55656 --- /dev/null +++ b/sys/fmio/fmrebuild.x @@ -0,0 +1,26 @@ +# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc. + +# FM_REBUILD -- Rebuild a datafile. This has no affect on the logical content +# of a datafile, but is desirable for efficiency reasons to eliminate waste +# space (e.g., from deleted lfiles), and render the file structures logically +# contiguous within the file, increasing i/o access efficiency. + +procedure fm_rebuild (dfname) + +char dfname[ARB] #I datafile name + +pointer sp, tfname +errchk fm_copy, fm_delete, fm_rename + +begin + call smark (sp) + call salloc (tfname, SZ_PATHNAME, TY_CHAR) + + # The copy operation rebuilds a datafile. + call mktemp (dfname, Memc[tfname], SZ_PATHNAME) + call fm_copy (dfname, Memc[tfname]) + call fm_delete (dfname) + call fm_rename (Memc[tfname], dfname) + + call sfree (sp) +end |