# HG changeset patch # User Rik # Date 1296365318 28800 # Node ID b6840c49fbdb35882c42722e497a2b24062d1b2e # Parent 75a496c7a3df3f3535eb21b38e3b2355317046ad Add S_ISBLK and family of functions to documentation. Improve docstrings for functions in System Utilities::File Utilities. diff -r 75a496c7a3df -r b6840c49fbdb doc/ChangeLog --- a/doc/ChangeLog Sat Jan 29 19:08:45 2011 -0800 +++ b/doc/ChangeLog Sat Jan 29 21:28:38 2011 -0800 @@ -1,3 +1,8 @@ +2011-01-29 Rik + + * interpreter/system.txi: Add S_ISBLK and related functions to + documentation. + 2011-01-29 Rik * interpreter/optim.txi: Add glpkmex function to documentation. diff -r 75a496c7a3df -r b6840c49fbdb doc/interpreter/system.txi --- a/doc/interpreter/system.txi Sat Jan 29 19:08:45 2011 -0800 +++ b/doc/interpreter/system.txi Sat Jan 29 21:28:38 2011 -0800 @@ -149,22 +149,23 @@ @node Filesystem Utilities @section Filesystem Utilities -Octave includes the following functions for renaming and deleting files, -creating, deleting, and reading directories, and for getting information -about the status of files. +Octave includes many utility functions for copying, moving, renaming, and deleting files; for creating, reading, and deleting directories; for retrieving +status information on files; and for manipulating file and path names. + +@DOCSTRING(movefile) @DOCSTRING(rename) +@DOCSTRING(copyfile) + +@DOCSTRING(unlink) + @DOCSTRING(link) @DOCSTRING(symlink) @DOCSTRING(readlink) -@DOCSTRING(unlink) - -@DOCSTRING(readdir) - @DOCSTRING(mkdir) @DOCSTRING(rmdir) @@ -178,43 +179,53 @@ @anchor{doc-lstat} @DOCSTRING(stat) +@DOCSTRING(S_ISBLK) + +@DOCSTRING(S_ISCHR) + +@DOCSTRING(S_ISDIR) + +@DOCSTRING(S_ISFIFO) + +@DOCSTRING(S_ISLNK) + +@DOCSTRING(S_ISREG) + @DOCSTRING(fileattrib) @DOCSTRING(isdir) +@DOCSTRING(readdir) + @DOCSTRING(glob) @DOCSTRING(fnmatch) @DOCSTRING(file_in_path) +@DOCSTRING(filesep) + +@DOCSTRING(filemarker) + +@DOCSTRING(fileparts) + +@DOCSTRING(fullfile) + @DOCSTRING(tilde_expand) @DOCSTRING(canonicalize_file_name) -@DOCSTRING(movefile) - -@DOCSTRING(copyfile) - -@DOCSTRING(fileparts) - -@DOCSTRING(filesep) - -@DOCSTRING(filemarker) - -@DOCSTRING(fullfile) - -@DOCSTRING(tempdir) - -@DOCSTRING(tempname) - -@DOCSTRING(P_tmpdir) +@DOCSTRING(make_absolute_filename) @DOCSTRING(is_absolute_filename) @DOCSTRING(is_rooted_relative_filename) -@DOCSTRING(make_absolute_filename) +@DOCSTRING(P_tmpdir) + +@DOCSTRING(tempdir) + +@DOCSTRING(tempname) @node File Archiving Utilities @section File Archiving Utilities diff -r 75a496c7a3df -r b6840c49fbdb scripts/ChangeLog --- a/scripts/ChangeLog Sat Jan 29 19:08:45 2011 -0800 +++ b/scripts/ChangeLog Sat Jan 29 21:28:38 2011 -0800 @@ -1,3 +1,8 @@ +2010-01-29 Rik + + * miscellaneous/copyfile.m, miscellaneous/movefile.m, + miscellaneous/tempname.m: Improve docstrings + 2010-01-29 Rik * deprecated/module.mk, image/module.mk: Deprecate saveimage.m. diff -r 75a496c7a3df -r b6840c49fbdb scripts/miscellaneous/copyfile.m --- a/scripts/miscellaneous/copyfile.m Sat Jan 29 19:08:45 2011 -0800 +++ b/scripts/miscellaneous/copyfile.m Sat Jan 29 21:28:38 2011 -0800 @@ -17,17 +17,18 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {[@var{status}, @var{msg}, @var{msgid}] =} copyfile (@var{f1}, @var{f2}, @var{force}) +## @deftypefn {Function File} {[@var{status}, @var{msg}, @var{msgid}] =} copyfile (@var{f1}, @var{f2}) +## @deftypefnx {Function File} {[@var{status}, @var{msg}, @var{msgid}] =} copyfile (@var{f1}, @var{f2}, 'f') ## Copy the file @var{f1} to the new name @var{f2}. The name @var{f1} ## may contain globbing patterns. If @var{f1} expands to multiple file -## names, @var{f2} must be a directory. If @var{force} is given and equals -## the string "f" the copy operation will be forced. +## names, @var{f2} must be a directory. If the force flag 'f' is given then +## existing destination files will be overwritten without prompting. ## -## If successful, @var{status} is 1, with @var{msg} and @var{msgid} empty\n\ -## character strings. Otherwise, @var{status} is 0, @var{msg} contains a\n\ -## system-dependent error message, and @var{msgid} contains a unique\n\ -## message identifier.\n\ -## @seealso{glob, movefile} +## If successful, @var{status} is 1, with @var{msg} and @var{msgid} empty +## character strings. Otherwise, @var{status} is 0, @var{msg} contains a +## system-dependent error message, and @var{msgid} contains a unique +## message identifier. +## @seealso{movefile} ## @end deftypefn function [status, msg, msgid] = copyfile (f1, f2, force) diff -r 75a496c7a3df -r b6840c49fbdb scripts/miscellaneous/movefile.m --- a/scripts/miscellaneous/movefile.m Sat Jan 29 19:08:45 2011 -0800 +++ b/scripts/miscellaneous/movefile.m Sat Jan 29 21:28:38 2011 -0800 @@ -17,16 +17,18 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {[@var{status}, @var{msg}, @var{msgid}] =} movefile (@var{f1}, @var{f2}) +## @deftypefn {Function File} {[@var{status}, @var{msg}, @var{msgid}] =} movefile (@var{f1}, @var{f2}) +## @deftypefnx {Function File} {[@var{status}, @var{msg}, @var{msgid}] =} movefile (@var{f1}, @var{f2}, 'f') ## Move the file @var{f1} to the new name @var{f2}. The name @var{f1} ## may contain globbing patterns. If @var{f1} expands to multiple file -## names, @var{f2} must be a directory. +## names, @var{f2} must be a directory. If the force flag 'f' is given +## then any existing files will be overwritten without prompting. ## -## If successful, @var{status} is 1, with @var{msg} and @var{msgid} empty\n\ -## character strings. Otherwise, @var{status} is 0, @var{msg} contains a\n\ -## system-dependent error message, and @var{msgid} contains a unique\n\ -## message identifier.\n\ -## @seealso{glob} +## If successful, @var{status} is 1, with @var{msg} and @var{msgid} empty +## character strings. Otherwise, @var{status} is 0, @var{msg} contains a +## system-dependent error message, and @var{msgid} contains a unique +## message identifier. +## @seealso{rename, copyfile} ## @end deftypefn function [status, msg, msgid] = movefile (f1, f2, force) diff -r 75a496c7a3df -r b6840c49fbdb scripts/miscellaneous/tempname.m --- a/scripts/miscellaneous/tempname.m Sat Jan 29 19:08:45 2011 -0800 +++ b/scripts/miscellaneous/tempname.m Sat Jan 29 21:28:38 2011 -0800 @@ -17,8 +17,11 @@ ## . ## -*- texinfo -*- -## @deftypefn {Function File} {filename =} tempname () +## @deftypefn {Function File} {} tempname () +## @deftypefnx {Function File} {} tempname (@var{dir}) +## @deftypefnx {Function File} {} tempname (@var{dir}, @var{prefix}) ## This function is an alias for @code{tmpnam}. +## @seealso{tmpnam} ## @end deftypefn function filename = tempname (varargin) diff -r 75a496c7a3df -r b6840c49fbdb src/ChangeLog --- a/src/ChangeLog Sat Jan 29 19:08:45 2011 -0800 +++ b/src/ChangeLog Sat Jan 29 21:28:38 2011 -0800 @@ -1,3 +1,10 @@ +2011-01-29 Rik + + * dirfns.cc (readdir, filesep, pathsep): Improve docstrings + * file-io.cc (tmpnam): Improve docstring + * input.cc (filemarker): Improve docstring + * syscalls.cc (stat, lstat): Improve docstring + 2011-01-29 Rik * DLD-FUNCTIONS/getrusage.cc, toplev.cc: Improve docstring diff -r 75a496c7a3df -r b6840c49fbdb src/dirfns.cc --- a/src/dirfns.cc Sat Jan 29 19:08:45 2011 -0800 +++ b/src/dirfns.cc Sat Jan 29 21:28:38 2011 -0800 @@ -157,7 +157,7 @@ If successful, @var{err} is 0 and @var{msg} is an empty string.\n\ Otherwise, @var{err} is nonzero and @var{msg} contains a\n\ system-dependent error message.\n\ -@seealso{dir, glob}\n\ +@seealso{ls, dir, glob}\n\ @end deftypefn") { octave_value_list retval; @@ -584,7 +584,7 @@ [2,1] = file2\n\ @}\n\ @end example\n\ -@seealso{dir, ls, stat, readdir, regexp}\n\ +@seealso{ls, dir, readdir}\n\ @end deftypefn") { octave_value retval; @@ -684,11 +684,11 @@ @deftypefnx {Built-in Function} {} filesep ('all')\n\ Return the system-dependent character used to separate directory names.\n\ \n\ -If 'all' is given, the function return all valid file separators in\n\ +If 'all' is given, the function returns all valid file separators in\n\ the form of a string. The list of file separators is system-dependent.\n\ -It is / (forward slash) under UNIX or Mac OS X, / and \\ (forward and\n\ -backward slashes) under Windows.\n\ -@seealso{pathsep, dir, ls}\n\ +It is @samp{/} (forward slash) under UNIX or Mac OS X, @samp{/} and @samp{\\}\n\ +(forward and backward slashes) under Windows.\n\ +@seealso{pathsep}\n\ @end deftypefn") { octave_value retval; @@ -719,9 +719,8 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {@var{val} =} pathsep ()\n\ @deftypefnx {Built-in Function} {@var{old_val} =} pathsep (@var{new_val})\n\ -Query or set the character used to separate directories in\n\ -a path.\n\ -@seealso{filesep, dir, ls}\n\ +Query or set the character used to separate directories in a path.\n\ +@seealso{filesep}\n\ @end deftypefn") { octave_value retval; diff -r 75a496c7a3df -r b6840c49fbdb src/file-io.cc --- a/src/file-io.cc Sat Jan 29 19:08:45 2011 -0800 +++ b/src/file-io.cc Sat Jan 29 21:28:38 2011 -0800 @@ -1853,7 +1853,9 @@ DEFUNX ("tmpnam", Ftmpnam, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} tmpnam (@var{dir}, @var{prefix})\n\ +@deftypefn {Built-in Function} {} tmpnam ()\n\ +@deftypefnx {Built-in Function} {} tmpnam (@var{dir})\n\ +@deftypefnx {Built-in Function} {} tmpnam (@var{dir}, @var{prefix})\n\ Return a unique temporary file name as a string.\n\ \n\ If @var{prefix} is omitted, a value of @code{\"oct-\"} is used.\n\ diff -r 75a496c7a3df -r b6840c49fbdb src/input.cc --- a/src/input.cc Sat Jan 29 19:08:45 2011 -0800 +++ b/src/input.cc Sat Jan 29 21:28:38 2011 -0800 @@ -1506,7 +1506,8 @@ DEFUN (filemarker, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {} filemarker ()\n\ +@deftypefn {Built-in Function} {@var{val} =} filemarker ()\n\ +@deftypefnx {Built-in Function} {} filemarker (@var{new_val})\n\ Query or set the character used to separate filename from the\n\ the subfunction names contained within the file. This can be used in\n\ a generic manner to interact with subfunctions. For example,\n\ diff -r 75a496c7a3df -r b6840c49fbdb src/syscalls.cc --- a/src/syscalls.cc Sat Jan 29 19:08:45 2011 -0800 +++ b/src/syscalls.cc Sat Jan 29 21:28:38 2011 -0800 @@ -743,8 +743,11 @@ DEFUNX ("lstat", Flstat, args, , "-*- texinfo -*-\n\ -@deftypefn {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{file})\n\ -See stat.\n\ +@deftypefn {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{symlink})\n\ +Return a structure @var{info} containing information about the symbolic link\n\ +@var{symlink}. The function outputs are described in the documentation for\n\ +@code{stat}.\n\ +@seealso{stat}\n\ @end deftypefn") { octave_value_list retval; @@ -880,7 +883,7 @@ @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} stat (@var{fid})\n\ @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{file})\n\ @deftypefnx {Built-in Function} {[@var{info}, @var{err}, @var{msg}] =} lstat (@var{fid})\n\ -Return a structure @var{s} containing the following information about\n\ +Return a structure @var{info} containing the following information about\n\ @var{file} or file identifier @var{fid}.\n\ \n\ @table @code\n\