Re: ESL project

new topic     » goto parent     » topic index » view thread      » older message » newer message

J> I've posted the esl modules to the archive, and they can be
J> retrieved from there if D. wants to use them for the project.  I
J> guess now I'll need something else to do, any suggestions?  

Yes, especially the routines in filesys.e.


global function copy_file(sequence fromfile, sequence tofile)
if exists(fromfile) = 0 then
	return 0
end if
if writef(tofile, readf(fromfile)) then
	return 1
end if

That means RAM is needed as much as 4 times the file size.

global function delete_file(sequence filename)
        atom a
        sequence rc
        rc = {}
if platform() = WIN32 or DOS32 then
  rc &= "del "
  rc &= filename
  system(rc, 2)


You should use system call for win32 and linux, that is much more
reliable.


global function move_file(sequence source, sequence dest)
sequence cs cs = {}

if copy_file(source, dest) then 
        if delete_file(source) then


Moving is not the same as copy+delete. The OS can optimize moving
files by changing the file pointer only.



global function rename_file(sequence fromfile, sequence tofile)
sequence cs cs = {}

if copy_file(fromfile, tofile) then     
        if delete_file(fromfile) then
                return 1
        end if


Likewise for this.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu