DIRECTORIES & FILES Updated: Aug 27, 2008 Directories and Files ~~~~~~~~~~~~~~~~~~~~~ CHDIR {new working directory path string expression} CHDIR "c:\temp" CHMOD {pathname string},{mode in hex or decimal} [Linux only] defint r = RETFUNC 'optionally get CHMOD success/error in r COPY {source pathname} {destination pathname} COPY "c:\hot\hb.bat", "e:\myprog\hb.bat" Note above that the file name hb.bat is used twice. This ensures that some Windows versions will not move the file instead of copy it. EXTRACTRESOURCE {RESOURCE(n) | descriptor}, {pathname string} EXTRACTRESOURCE "my_bmp","myfile.bmp" DELETE {pathname string} DELETE "myfile.bmp" 'same as KILL KILL {pathname string} string = pathname | file name in current directory. KILL does not enter the deleted file into the Recycle Bin. LIBRARYINST {pathname string} installs library string (not needed at present). MKDIR {pathname string} 'name of new directory to create. MKDIR "c:\hotbasic\archive" MOVE {pathname string1}, {pathname string2} Moves file string1 to file string2 If a file with name string2 does not already exist. See RENAME. RENAME {pathname string1}, {pathname string2} Renames string1 to string2 if string2 does not already exist. Hint: If file string2 exists, file string1 will not be renamed. Therefore, KILL string2 may be used first to ensure that file string1 is actually renamed from string1 to string2. RMDIR {pathname string} RMDIR "c:\mytemp" 'directory to delete. UNLOADLIBRARY {pathname string} 'library to unload. Please see String Functions CURDIR$, DIR$ and WINDIR$ and Numeric Functions DIREXISTS and FILEEXISTS. The FILE object provides detailed file and IO port methods to read and write data. The .LoadFromFile and .SaveToFile methods in STRING, MEMORY, LIST and certain FORM objects provide "one-stop" file access. + Penthouse (registered) version Copyright 2003-2007 James J Keene PhD Original Publication: Oct 8, 2003