From 40e5a5811c6ffce9b0974e93cdd927cbcf60c157 Mon Sep 17 00:00:00 2001 From: Joe Hunkeler Date: Tue, 11 Aug 2015 16:51:37 -0400 Subject: Repatch (from linux) of OSX IRAF --- sys/fmio/fmrebuild.x | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sys/fmio/fmrebuild.x (limited to 'sys/fmio/fmrebuild.x') 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 -- cgit