fileops.c File Reference

#include "frontier.h"
#include "standard.h"
#include "filealias.h"
#include "cursor.h"
#include "dialogs.h"
#include "error.h"
#include "memory.h"
#include "ops.h"
#include "quickdraw.h"
#include "resources.h"
#include "strings.h"
#include "timedate.h"
#include "frontierwindows.h"
#include "file.h"
#include "shell.h"
#include "shell.rsrc.h"
#include "langinternal.h"

Include dependency graph for fileops.c:

Go to the source code of this file.

Typedefs

typedef tyfileinfo tyvolinfo

Functions

void setfserrorparam (const tyfilespec *fs)
boolean endswithpathsep (bigstring bs)
boolean cleanendoffilename (bigstring bs)
boolean getmachinename (bigstring bsname)
boolean filegetinfo (const tyfilespec *fs, tyfileinfo *info)
boolean filegetvolumename (short vnum, bigstring volname)
boolean fileisbusy (const tyfilespec *fs, boolean *flbusy)
boolean filehasbundle (const tyfilespec *fs, boolean *flbundle)
boolean filesetbundle (const tyfilespec *fs, boolean flbundle)
boolean fileisalias (const tyfilespec *fs, boolean *flalias)
boolean fileisvisible (const tyfilespec *fs, boolean *flvisible)
boolean filesetvisible (const tyfilespec *fs, boolean flvisible)
boolean getfiletype (const tyfilespec *fs, OSType *type)
boolean getfilecreator (const tyfilespec *fs, OSType *creator)
boolean filesize (const tyfilespec *fs, long *size)
boolean fileisfolder (const tyfilespec *fs, boolean *flfolder)
boolean fileisvolume (const tyfilespec *fs)
boolean fileislocked (const tyfilespec *fs, boolean *fllocked)
boolean getfiledates (const tyfilespec *fs, unsigned long *datecreated, unsigned long *datemodified)
boolean setfiledates (const tyfilespec *fs, unsigned long datecreated, unsigned long datemodified)
boolean setfilecreated (const tyfilespec *fs, long when)
boolean setfilemodified (const tyfilespec *fs, long when)
boolean largefilebuffer (Handle *hbuffer)
short filegetapplicationrnum (void)
boolean getspecialfolderpath (bigstring bsvol, bigstring bsfolder, boolean flcreate, tyfilespec *fs)
boolean isejectable (const tyfilespec *fs, boolean *flejectable)
boolean getfreespace (const tyfilespec *fs, long *ctfreebytes)
static void volumeinfoerror (OSErr errnum)
boolean langgetextendedvolumeinfo (const tyfilespec *fs, double *totalbytes, double *freebytes)
boolean getvolumesize (const tyfilespec *fs, long *ctbytes)
boolean getvolumeblocksize (const tyfilespec *fs, long *ctbytes)
boolean filesonvolume (const tyfilespec *fs, long *ctfiles)
boolean foldersonvolume (const tyfilespec *fs, long *ctfolders)
boolean isvolumelocked (const tyfilespec *fs, boolean *fllocked)
boolean volumecreated (const tyfilespec *fs, unsigned long *createdate)
boolean lockvolume (const tyfilespec *fs, boolean fllock)
boolean fileparsevolname (bigstring bspath, short *vnum, bigstring bsvol)
boolean filefrompath (bigstring path, bigstring fname)
boolean folderfrompath (bigstring path, bigstring folder)
boolean movefile (const tyfilespec *fs, const tyfilespec *fsto)
void filenotfounderror (bigstring bs)
boolean surefile (const tyfilespec *fs)
boolean renamefile (const tyfilespec *fs, bigstring bsnew)
boolean lockfile (const tyfilespec *fs)
boolean unlockfile (const tyfilespec *fs)
boolean newfolder (const tyfilespec *fs)
boolean newfile (const tyfilespec *fs, OSType creator, OSType filetype)
boolean initfile (void)
boolean findapplication (OSType creator, tyfilespec *fsapp)

Variables

static short applicationresnum = -1


Typedef Documentation

typedef struct tyfileinfo tyvolinfo
 

Definition at line 133 of file fileops.c.


Function Documentation

boolean cleanendoffilename bigstring  bs  ) 
 

Definition at line 174 of file fileops.c.

References endswithpathsep(), setstringlength, and stringlength.

Referenced by deletefile(), fileexists(), filegetinfo(), folderfrompathverb(), langgetextendedvolumeinfo(), movefile(), and parsepageaddress().

Here is the call graph for this function:

boolean endswithpathsep bigstring  bs  ) 
 

Definition at line 151 of file fileops.c.

References stringlength.

Referenced by cleanendoffilename(), filefrompathverb(), and movefile().

boolean filefrompath bigstring  path,
bigstring  fname
 

Definition at line 2811 of file fileops.c.

References copyctopstring(), copystring(), fileisvolume(), fsname, isemptystring, lastword(), NULL, nullterminate, setemptystring, and stringlength.

Referenced by filefrompathverb(), folderfrompath(), getfsfile(), movefile(), openlibrary(), parsepageaddress(), renamefile(), shellclose(), and shellrevert().

Here is the call graph for this function:

short filegetapplicationrnum void   ) 
 

Definition at line 1746 of file fileops.c.

References applicationresnum.

Referenced by checktable(), and osacomponentstart().

boolean filegetinfo const tyfilespec fs,
tyfileinfo info
 

Definition at line 660 of file fileops.c.

References cleanendoffilename(), clearbytes(), copystring(), filegetinfofrompb(), fileisvolume(), fsname, getmacfileinfo(), info, NULL, nullterminate, and verify.

Here is the call graph for this function:

boolean filegetvolumename short  vnum,
bigstring  volname
 

Definition at line 759 of file fileops.c.

boolean filehasbundle const tyfilespec fs,
boolean flbundle
 

Definition at line 824 of file fileops.c.

References filegetinfo(), and info.

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean fileisalias const tyfilespec fs,
boolean flalias
 

Definition at line 866 of file fileops.c.

References filegetinfo(), and info.

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean fileisbusy const tyfilespec fs,
boolean flbusy
 

Definition at line 807 of file fileops.c.

References filegetinfo(), and info.

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean fileisfolder const tyfilespec fs,
boolean flfolder
 

Definition at line 991 of file fileops.c.

References copystring(), filegetinfo(), fileisvolume(), fsname, info, and stringlength.

Referenced by deletefile(), filefunctionvalue(), filespecaddvalue(), and movefile().

Here is the call graph for this function:

boolean fileislocked const tyfilespec fs,
boolean fllocked
 

Definition at line 1069 of file fileops.c.

References filegetinfo(), and info.

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean fileisvisible const tyfilespec fs,
boolean flvisible
 

Definition at line 883 of file fileops.c.

References filegetinfo(), and info.

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean fileisvolume const tyfilespec fs  ) 
 

Definition at line 1025 of file fileops.c.

References bigstring, copystring(), fsname, getlower, isemptystring, and stringlength.

Referenced by fileexists(), filefrompath(), filefunctionvalue(), filegetinfo(), fileisfolder(), and pathtofilespec().

Here is the call graph for this function:

void filenotfounderror bigstring  bs  ) 
 

Definition at line 2996 of file fileops.c.

References oserror(), and setoserrorparam().

Referenced by ccloadspecialfile(), coercetofilespec(), and surefile().

Here is the call graph for this function:

boolean fileparsevolname bigstring  bspath,
short vnum,
bigstring  bsvol
 

Definition at line 2681 of file fileops.c.

References bigstring, clearbytes(), copystring(), deletestring(), isallnumeric(), isemptystring, midstring(), nil, noErr, nullterminate, pushchar(), scanstring(), setemptystring, setstringlength, stringlength, and stringtoshort().

Referenced by aliastofilespec(), getfsvolume(), and getvolumevalue().

Here is the call graph for this function:

boolean filesetbundle const tyfilespec fs,
boolean  flbundle
 

Definition at line 841 of file fileops.c.

References getmacfileinfo(), and setmacfileinfo().

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean filesetvisible const tyfilespec fs,
boolean  flvisible
 

Definition at line 900 of file fileops.c.

References filegetinfo(), fsname, getmacfileinfo(), info, and setmacfileinfo().

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean filesize const tyfilespec fs,
long size
 

Definition at line 978 of file fileops.c.

References filegetinfo(), and info.

Referenced by filefunctionvalue(), filegetsize(), filereadhandle(), and webservercallresponder().

Here is the call graph for this function:

boolean filesonvolume const tyfilespec fs,
long ctfiles
 

Definition at line 2209 of file fileops.c.

References tyfileinfo::ctfiles.

Referenced by filefunctionvalue().

boolean findapplication OSType  creator,
tyfilespec fsapp
 

Definition at line 3275 of file fileops.c.

References bigstring, chnul, deletestring(), firstword(), FSRefMakeFSSpec(), getRegKeyString(), insertchar(), lastword(), noErr, NULL, ostypetostring(), pathtofilespec(), popleadingchars(), poptrailingwhitespace(), pushchar(), pushstring(), and stringlength.

Here is the call graph for this function:

boolean folderfrompath bigstring  path,
bigstring  folder
 

Definition at line 2864 of file fileops.c.

References bigstring, copystring(), filefrompath(), setstringlength, and stringlength.

Referenced by folderfrompathverb(), parsepageaddress(), pathtofilespec(), renamefile(), and setfsfile().

Here is the call graph for this function:

boolean foldersonvolume const tyfilespec fs,
long ctfolders
 

Definition at line 2226 of file fileops.c.

References tyfileinfo::ctfolders.

Referenced by filefunctionvalue().

boolean getfilecreator const tyfilespec fs,
OSType creator
 

Definition at line 963 of file fileops.c.

References filegetinfo(), and info.

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean getfiledates const tyfilespec fs,
unsigned long datecreated,
unsigned long datemodified
 

Definition at line 1082 of file fileops.c.

References filegetinfo(), and info.

Referenced by filefunctionvalue(), setfilecreated(), and setfilemodified().

Here is the call graph for this function:

boolean getfiletype const tyfilespec fs,
OSType type
 

Definition at line 948 of file fileops.c.

References filegetinfo(), and info.

Referenced by filefunctionvalue(), shellnormalsaveas(), shellopenfile(), and shellsave().

Here is the call graph for this function:

boolean getfreespace const tyfilespec fs,
long ctfreebytes
 

Definition at line 2036 of file fileops.c.

References tyfileinfo::ctfreebytes.

Referenced by filefunctionvalue().

boolean getmachinename bigstring  bsname  ) 
 

Definition at line 184 of file fileops.c.

References bigstring, fl, nil, setemptystring, setstringlength, and texthandletostring().

Referenced by langpackfileval().

Here is the call graph for this function:

boolean getspecialfolderpath bigstring  bsvol,
bigstring  bsfolder,
boolean  flcreate,
tyfilespec fs
 

Definition at line 1796 of file fileops.c.

References bigstring, chspace, tyfileinfo::dirid, equalidentifiers(), findstringlist(), firstword(), fsname, gestalt(), isemptystring, nil, noErr, NULL, nullterminate, oserror(), pushchar(), setoserrorparam(), setstringlength, specialfolderlistnumber, stringlength, and stringtoostype().

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean getvolumeblocksize const tyfilespec fs,
long ctbytes
 

Definition at line 2196 of file fileops.c.

References tyfileinfo::blocksize.

Referenced by filefunctionvalue().

boolean getvolumesize const tyfilespec fs,
long ctbytes
 

Definition at line 2183 of file fileops.c.

References tyfileinfo::cttotalbytes.

Referenced by filefunctionvalue().

boolean initfile void   ) 
 

Definition at line 3235 of file fileops.c.

References applicationresnum, initfiledialog(), nil, and RememberA5.

Referenced by shellinit().

Here is the call graph for this function:

boolean isejectable const tyfilespec fs,
boolean flejectable
 

Definition at line 2023 of file fileops.c.

References tyfileinfo::flejectable.

Referenced by filefunctionvalue().

boolean isvolumelocked const tyfilespec fs,
boolean fllocked
 

Definition at line 2239 of file fileops.c.

References tyfileinfo::fllocked.

Referenced by filefunctionvalue().

boolean langgetextendedvolumeinfo const tyfilespec fs,
double *  totalbytes,
double *  freebytes
 

Definition at line 2067 of file fileops.c.

References bigstring, cleanendoffilename(), copystring(), flsupportslargevolumes, FSGetVInfo(), fsname, nil, noErr, nullterminate, pushchar(), volumeinfoerror(), and XGetVInfo().

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean largefilebuffer Handle hbuffer  ) 
 

Definition at line 1349 of file fileops.c.

References FreeMem(), h, memoryerror(), newhandle(), NewHandle, and nil.

Referenced by copyonefile(), fifcharcounter(), and fiffindinfile().

Here is the call graph for this function:

boolean lockfile const tyfilespec fs  ) 
 

Definition at line 3094 of file fileops.c.

References error, fsname, oserror(), and setfserrorparam().

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean lockvolume const tyfilespec fs,
boolean  fllock
 

Definition at line 2269 of file fileops.c.

References oserror().

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean movefile const tyfilespec fs,
const tyfilespec fsto
 

Definition at line 2926 of file fileops.c.

References appendcstring(), bigstring, cleanendoffilename(), copystring(), endswithpathsep(), filefrompath(), fileisfolder(), fl, fsname, getmacfileinfo(), nullterminate, oserror(), pushstring(), setfserrorparam(), setstringlength, and stringlength.

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean newfile const tyfilespec fs,
OSType  creator,
OSType  filetype
 

Definition at line 3177 of file fileops.c.

References copystring(), fsname, NULL, nullterminate, oserror(), setfserrorparam(), and verify.

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean newfolder const tyfilespec fs  ) 
 

Definition at line 3153 of file fileops.c.

References fsname, NULL, oserror(), and setfserrorparam().

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean renamefile const tyfilespec fs,
bigstring  bsnew
 

Definition at line 3031 of file fileops.c.

References bigstring, copystring(), filefrompath(), folderfrompath(), fsname, nullterminate, oserror(), pushstring(), setoserrorparam(), and surefile().

Referenced by clayrenamefile(), and filefunctionvalue().

Here is the call graph for this function:

boolean setfilecreated const tyfilespec fs,
long  when
 

Definition at line 1210 of file fileops.c.

References getfiledates(), and setfiledates().

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean setfiledates const tyfilespec fs,
unsigned long  datecreated,
unsigned long  datemodified
 

Definition at line 1097 of file fileops.c.

References copystring(), fl, foldertest(), fsname, getmacfileinfo(), h, NULL, nullterminate, oserror(), setmacfileinfo(), and verify.

Referenced by setfilecreated(), and setfilemodified().

Here is the call graph for this function:

boolean setfilemodified const tyfilespec fs,
long  when
 

Definition at line 1225 of file fileops.c.

References getfiledates(), and setfiledates().

Referenced by filefunctionvalue().

Here is the call graph for this function:

void setfserrorparam const tyfilespec fs  ) 
 

Definition at line 136 of file fileops.c.

References fsname, and setoserrorparam().

Referenced by deletefile(), filecreateandopen(), lockfile(), movefile(), newfile(), newfolder(), openfile(), and unlockfile().

Here is the call graph for this function:

boolean surefile const tyfilespec fs  ) 
 

Definition at line 3018 of file fileops.c.

References fileexists(), filenotfounderror(), and fsname.

Referenced by renamefile().

Here is the call graph for this function:

boolean unlockfile const tyfilespec fs  ) 
 

Definition at line 3124 of file fileops.c.

References error, fsname, oserror(), and setfserrorparam().

Referenced by filefunctionvalue().

Here is the call graph for this function:

boolean volumecreated const tyfilespec fs,
unsigned long createdate
 

Definition at line 2256 of file fileops.c.

References tyfileinfo::timecreated.

Referenced by filefunctionvalue().

static void volumeinfoerror OSErr  errnum  )  [static]
 

Definition at line 2053 of file fileops.c.

References BIGSTRING, bigstring, copystring(), nil, numbertostring(), parsedialogstring(), and shellerrormessage().

Referenced by langgetextendedvolumeinfo().

Here is the call graph for this function:


Variable Documentation

short applicationresnum = -1 [static]
 

Definition at line 96 of file fileops.c.

Referenced by filegetapplicationrnum(), and initfile().


Generated on Thu Jun 1 07:04:28 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6