Re: File handling
- Posted by Terry Constant <constant at FLASH.NET> Jun 07, 1998
- 491 views
mountains at MINDSPRING.COM wrote: > > At 08:05 PM 6/6/98 -0300, you wrote: > >Has anyone done routines for deleting, renaming, copying, moving, and > >creating temporary files? > > > How about system(delete, rename, mkdir, rmdir, attrib)? > The main problem with system() is the lack of error reporting if one of the commands fail for some reason. I have written two special routines that use system() and the special features of 4Dos to capture stderr output, exit code of internal commands, and exit code of external commands. But these routines are kludges. If there were a system type function that could capture and return such information, it would be a step forward. One possible example, using 4Dos.com: sequence errinfo errinfo = systemcap("Rename MyFile ThisFile",?) errinfo would contain {atom, atom, sequence} that is, {External exit code, internal exit code, sequence containing stderr} Its been so long since I worked with Command.com, I can't remember if there is a way to get exit code info on internal commands. If not there would only be one atom. In any case, the return sequence would have information about success or failure that could be analyzed. -- Terry Constant constant at flash.net