diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-08 20:46:52 -0400 |
commit | fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4 (patch) | |
tree | bdda434976bc09c864f2e4fa6f16ba1952b1e555 /sys/fmio/fmrebuild.x | |
download | iraf-linux-fa080de7afc95aa1c19a6e6fc0e0708ced2eadc4.tar.gz |
Initial commit
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 |