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

Re: Deleting Files with SQR



Hi,

These functions are helpfully located under the LET command in your SQR
3 manual. (page 227)

begin-program
if exists('c:\temp\foo.dat') = 0 ! 0 is success for file functions
   let #tmp = delete('c:\temp\foo.dat')
   if #tmp != 0
      show 'Oops an error happened'
   else
      show 'It''s gone'
   end-if
end-if
end-program

Hope this helps,
Eric

On Tue, 10 Mar 1998, Chris Hagen wrote:

>      HELLO.
>
>      I am writing some interface programs and am wondering if it is
>      possible to write a small SQR that will delete a file if that file
>      exists.
>
>      I would like the program to:
>
>      1) Read C:\TEMP
>      2) See if C:\TEMP\FOO.dat exists.
>      3) Delete C:\TEMP\FOO.dat if it indeed exists.
>
>      I have looked through the B-board postings and my SQR documentation
>      but have not seen anything discussing this issue.
>
>      Thank you for your time and consideration.
>
>      Chris
>

------------------------------------------------------------------------
Eric Dimick Eastman |Ray Ontko & Co|About 6,000 years ago, in 7 days,
erice@ontko.com     |Richmond, IN  |God created the Earth, complete
http://www.ontko.com|              |with 5,000,000,000 years of history.