copy and check file

i wanted to check a file 'abc.exe' is or is not in c:
if in c: then copy it and delete

Comments

  • : i wanted to check a file 'abc.exe' is or is not in c:

    You can use function FSearch from module Dos.
    Result is keep in pre-defined PathStr type.
    example of use:

    uses Dos;
    var
    variable: PathStr;
    (...)
    variable:=FSearch ('file.ext',"path1;path2;path3");
    (...)

    in this case:
    uses Dos;
    var
    variable: PathStr;
    (...)
    variable:=FSearch ('abc.exe',"c:");
    if variable='' then write('There is no abc.exe file')
    else write('There is abc.exe file');
    (...)

    I don't know any function that is able to copy file. I think you must rewrite it to another file.
  • : : i wanted to check a file 'abc.exe' is or is not in c:
    :
    : You can use function FSearch from module Dos.
    : Result is keep in pre-defined PathStr type.
    : example of use:
    :
    : uses Dos;
    : var
    : variable: PathStr;
    : (...)
    : variable:=FSearch ('file.ext',"path1;path2;path3");
    : (...)
    :
    : in this case:
    : uses Dos;
    : var
    : variable: PathStr;
    : (...)
    : variable:=FSearch ('abc.exe',"c:");
    : if variable='' then write('There is no abc.exe file')
    : else write('There is abc.exe file');
    : (...)
    :
    : I don't know any function that is able to copy file. I think you must rewrite it to another file.
    :
    You could try using the RENAME command. I can't remember if it will let you 'rename' it to a different directory or not. This would also ERASE the file at the same time.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories