home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / tcl_447.lzh / TCL / tcl.lzh / tcl / help / file < prev    next >
Text File  |  1990-05-03  |  2KB  |  62 lines

  1.  file name option
  2.       Operate on a file or a file name.  Name is the name of
  3.       a file, and option indicates what to do with the file
  4.       name.  Any unique abbreviation for option is
  5.       acceptable.  The valid options are:
  6.  
  7.       file name dirname
  8.     Return all of the characters in name up to but not
  9.     including the last slash character.  If there are
  10.     no slashes in name then return ``.''.  If the last
  11.     slash in name is its first character, then return
  12.     ``/''.
  13.  
  14.       file name executable
  15.     Return 1 if file name is executable by the current
  16.     user, 0 otherwise.
  17.  
  18.       file name exists
  19.     Return 1 if file name exists and the current user
  20.     has search privileges for the directories leading
  21.     to it, 0 otherwise.
  22.  
  23.       file name extension
  24.     Return all of the characters in name after and
  25.     including the last dot in name.  If there is no
  26.     dot in name then return the empty string.
  27.  
  28.       file name isdirectory
  29.     Return 1 if file name is a directory, 0 otherwise.
  30.  
  31.       file name isfile
  32.     Return 1 if file name is a regular file, 0
  33.     otherwise.
  34.  
  35.       file name owned
  36.     Return 1 if file name is owned by the current
  37.     user, 0 otherwise.
  38.  
  39.       file name readable
  40.     Return 1 if file name is readable by the current
  41.     user, 0 otherwise.
  42.  
  43.       file name rootname
  44.     Return all of the characters in name up to but not
  45.     including the last ``.'' character in the name.
  46.     If name doesn't contain a dot, then return name.
  47.  
  48.       file name tail
  49.     Return all of the characters in name after the
  50.     last slash.  If name contains no slashes then
  51.     return name.
  52.  
  53.       file name writable
  54.     Return 1 if file name is writable by the current
  55.     user, 0 otherwise.
  56.  
  57.       The file commands that return 0/1 results are often
  58.       used in conditional or looping commands, for example:
  59.  
  60.       if {![file foo exists]} then {error {bad file name}} else {...}
  61.  
  62.