[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: System Call to Copy & Rename file



There is also the sqr 'rename' function (at least in 4.3),
but it does just that--rename a file. If you still want to
keep a copy of the original file, then this function is not
what you're looking for.

Cherno.

PS - I'm just wondering, though, why SQR would provide
'rename', 'delete', and 'exists' functions but no 'copy'?
If I had to provide only 3 file-related functions, I would've
gone with copy, delete, and exists, since rename can be
achieved with using copy and delete.


>>> "Wendel, Robbi" <rwendel@NESPOWER.COM> 06/19 3:37 PM >>>
Hello All,
        I have been asked to do some file manipulation within an SQR
that is
currently being done by the user after completion of the SQR.  The SQR
creates a file called payroll.dk in C:\TEMP .  This flat file is then
copied
by the user into another folder C:\SavBond with a new name that
corresponds
with a date that was prompted during the run of the SQR.  I have written
this code segment, and for the life of me can not get it to run.  The
new
file name would be in the format of 06_15_00.txt   I am running Win98.
I
have tested this COPY command at the MSDOS prompt and it works, but it
won't
work from with SQR.  I know it must be something really easy that I am
missing.  Any help is greatly appreciated  - even if the result is that
I am
a dope !!

Begin-procedure System-call
Let $filename = '06_15_00.txt'
Let $command_str = 'COPY C:\TEMP\payroll.dk C:\SavBond\'||$filename
Display $command_str
  Call System Using $command_str  #stat
    if #stat <> 0           !failed
      Display 'Copy/Rename of Payroll.dk Failed.'
      Display #stat
      stop quiet
   else
      Display 'Copy/Rename of Payroll.dk Completed.'
   end-if
End-procedure System-call


TIA,
Robbi