Loading ...
Sorry, an error occurred while loading the content.

Re: [BCX] Moving and then deleting remaining unmoved files.

Expand Messages
  • Doyle Whisenant
    ... The first example in the help file under COPYFILE shows how to move a file by copying it to a different folder. Then just KILL the file in the original
    Message 1 of 7 , Apr 5 3:08 AM
    View Source
    • 0 Attachment
      David wrote:
      > First of all I'd like to thank everyone who has read and replied to my many recent posts. I'm finding BCX and this forum very helpful.
      > I will have many more questions to ask over the next six months until my little project is complete, please be patient.
      > Now to my question. Is it possible to move a set of files to another new directory and then delete the remaining unmoved files in the original directory using BCX functions? There is a copyfile function and a kill function but I have not found a MOVEFILE function. Do I have to rely on passing a DOS command to the operating system to do this?
      > Will Windows 7 even let me do this?
      > I hope there is some way of using copyfile and kill to do the same thing.
      > Thanks.
      >

      The first example in the help file under "COPYFILE" shows how to move a
      file by copying it to a different folder. Then just KILL the file in the
      original folder. I don't think BCX has a true MOVE command but I could
      be wrong.

      COPYFILE SourceFile$, DestinationFile$ [,TRUE | FALSE]

      Src$ = "c:\bcx\gui_demo\calendar\cal.exe"
      Dest$ = "c:\test\cal.exe"
      COPYFILE Src$, Dest$


      --
      Thanks,
      Doyle
    • Ad Rienks
      The example on the FINDFIRST$ function page shows how to copy a set of files. Simply add a KILL statement in the WHILE ... WEND loop, and you re done! 2012/4/5
      Message 2 of 7 , Apr 5 3:12 AM
      View Source
      • 0 Attachment
        The example on the FINDFIRST$ function page shows how to copy a set of files. Simply add a KILL statement in the WHILE ... WEND loop, and you're done!

        2012/4/5 David <david@...>
         

        First of all I'd like to thank everyone who has read and replied to my many recent posts. I'm finding BCX and this forum very helpful.
        I will have many more questions to ask over the next six months until my little project is complete, please be patient.
        Now to my question. Is it possible to move a set of files to another new directory and then delete the remaining unmoved files in the original directory using BCX functions? There is a copyfile function and a kill function but I have not found a MOVEFILE function. Do I have to rely on passing a DOS command to the operating system to do this?
        Will Windows 7 even let me do this?
        I hope there is some way of using copyfile and kill to do the same thing.
        Thanks.

        David.


      • wmhalsdorf
        ... Support for the MoveFile function in windows wasn t added till Windows XP. If you want to directly use it just do something like this.
        Message 3 of 7 , Apr 5 11:14 AM
        View Source
        • 0 Attachment
          --- In BCX@yahoogroups.com, "David" <david@...> wrote:
          >
          > First of all I'd like to thank everyone who has read and replied to my many recent posts. I'm finding BCX and this forum very helpful.
          > I will have many more questions to ask over the next six months until my little project is complete, please be patient.
          > Now to my question. Is it possible to move a set of files to another new directory and then delete the remaining unmoved files in the original directory using BCX functions? There is a copyfile function and a kill function but I have not found a MOVEFILE function. Do I have to rely on passing a DOS command to the operating system to do this?
          > Will Windows 7 even let me do this?
          > I hope there is some way of using copyfile and kill to do the same thing.
          > Thanks.
          >
          > David.
          >

          Support for the MoveFile function in windows wasn't added till
          Windows XP. If you want to directly use it just do something like
          this.
          MoveFile(szSourceFile$,szDestinstion$)
          Where szSourceFile$ is the name of the file include path if not in
          that directory, best to assume that you are not.
          Where szDestinstion$ is the name of the file or directory that you
          are moving the file to.
        • David
          ... I ve tried this DIM F$ DIM CurrentDirectory$ DIM NetworkUsername$ DIM NewDirectory$ DIM NewDirectoryPath$ DIM SourceDirectory$ DIM DestinationDirectory$
          Message 4 of 7 , Apr 7 7:37 AM
          View Source
          • 0 Attachment
            --- In BCX@yahoogroups.com, Ad Rienks <ad.rienks@...> wrote:
            >
            > The example on the FINDFIRST$ function page shows how to copy a set of
            > files. Simply add a KILL statement in the WHILE ... WEND loop, and you're
            > done!
            >
            > 2012/4/5 David <david@...>
            >
            > > **
            > >
            > >
            > > First of all I'd like to thank everyone who has read and replied to my
            > > many recent posts. I'm finding BCX and this forum very helpful.
            > > I will have many more questions to ask over the next six months until my
            > > little project is complete, please be patient.
            > > Now to my question. Is it possible to move a set of files to another new
            > > directory and then delete the remaining unmoved files in the original
            > > directory using BCX functions? There is a copyfile function and a kill
            > > function but I have not found a MOVEFILE function. Do I have to rely on
            > > passing a DOS command to the operating system to do this?
            > > Will Windows 7 even let me do this?
            > > I hope there is some way of using copyfile and kill to do the same thing.
            > > Thanks.
            > >
            > > David.
            > >
            > >
            > >
            >

            I've tried this

            DIM F$
            DIM CurrentDirectory$
            DIM NetworkUsername$
            DIM NewDirectory$
            DIM NewDirectoryPath$
            DIM SourceDirectory$
            DIM DestinationDirectory$

            NetworkUsername$ = "abcdefg"
            CurrentDirectory$ = CURDIR$
            NewDirectory$ = NetworkUsername$
            NewDirectoryPath$ = CurrentDirectory$ + "\" + NewDirectory$
            ' + "_" + DATE$

            PRINT NewDirectory$
            PRINT CurrentDirectory$
            PRINT NewDirectoryPath$


            MKDIR NewDirectory$


            F$ = FINDFIRST$("SGerber.*")
            SourceDirectory$ = CurrentDirectory$
            DestinationDirectory$ = NewDirectoryPath$

            WHILE F$ > ""
            COPYFILE SourceDirectory$ + F$, DestinationDirectory$ + F$
            F$ = FINDNEXT$
            WEND

            It creates a directory called abcdefg beneath the directory where it's run but it will NOT move any of the files. It makes no difference if I change the filespec to *.*.
            I'm using using BCX version 6.8.6 (2012/02/04)

            Here is the main C function

            int main(int argc, char *argv[])
            {
            strcpy(NetworkUsername,"abcdefg");
            strcpy(CurrentDirectory,curdir());
            strcpy(NewDirectory,NetworkUsername);
            strcpy(NewDirectoryPath, join(3,CurrentDirectory,chr(92),NewDirectory));
            printf("%s\n",NewDirectory);
            printf("%s\n",CurrentDirectory);
            printf("%s\n",NewDirectoryPath);
            mkdir (NewDirectory);
            strcpy(F,findfirst("SGerber.*"));
            strcpy(SourceDirectory,CurrentDirectory);
            strcpy(DestinationDirectory,NewDirectoryPath);
            while(F[0]>0)
            {
            CopyFile (join(2,SourceDirectory,F),join(2,DestinationDirectory,F),FALSE);
            strcpy(F,findnext());
            }

            return 0; /* End of main program */
            }

            Can anyone get this to run?

            Thanks.

            David.
          • Ad Rienks
            SourceDirectory$ = CurrentDirectory$ + DestinationDirectory$ = NewDirectoryPath$ + 2012/4/7 David
            Message 5 of 7 , Apr 7 8:30 AM
            View Source
            • 0 Attachment
              SourceDirectory$ = CurrentDirectory$ + "\"
              DestinationDirectory$ = NewDirectoryPath$ + "\"

              2012/4/7 David <david@...>
               



              --- In BCX@yahoogroups.com, Ad Rienks <ad.rienks@...> wrote:
              >
              > The example on the FINDFIRST$ function page shows how to copy a set of
              > files. Simply add a KILL statement in the WHILE ... WEND loop, and you're
              > done!
              >
              > 2012/4/5 David <david@...>
              >
              > > **
              > >
              > >
              > > First of all I'd like to thank everyone who has read and replied to my
              > > many recent posts. I'm finding BCX and this forum very helpful.
              > > I will have many more questions to ask over the next six months until my
              > > little project is complete, please be patient.
              > > Now to my question. Is it possible to move a set of files to another new
              > > directory and then delete the remaining unmoved files in the original
              > > directory using BCX functions? There is a copyfile function and a kill
              > > function but I have not found a MOVEFILE function. Do I have to rely on
              > > passing a DOS command to the operating system to do this?
              > > Will Windows 7 even let me do this?
              > > I hope there is some way of using copyfile and kill to do the same thing.
              > > Thanks.
              > >
              > > David.
              > >
              > >
              > >
              >

              I've tried this

              DIM F$
              DIM CurrentDirectory$
              DIM NetworkUsername$
              DIM NewDirectory$
              DIM NewDirectoryPath$
              DIM SourceDirectory$
              DIM DestinationDirectory$

              NetworkUsername$ = "abcdefg"
              CurrentDirectory$ = CURDIR$
              NewDirectory$ = NetworkUsername$
              NewDirectoryPath$ = CurrentDirectory$ + "\" + NewDirectory$
              ' + "_" + DATE$

              PRINT NewDirectory$
              PRINT CurrentDirectory$
              PRINT NewDirectoryPath$

              MKDIR NewDirectory$

              F$ = FINDFIRST$("SGerber.*")
              SourceDirectory$ = CurrentDirectory$
              DestinationDirectory$ = NewDirectoryPath$

              WHILE F$ > ""
              COPYFILE SourceDirectory$ + F$, DestinationDirectory$ + F$
              F$ = FINDNEXT$
              WEND

              It creates a directory called abcdefg beneath the directory where it's run but it will NOT move any of the files. It makes no difference if I change the filespec to *.*.
              I'm using using BCX version 6.8.6 (2012/02/04)

              Here is the main C function

              int main(int argc, char *argv[])
              {
              strcpy(NetworkUsername,"abcdefg");
              strcpy(CurrentDirectory,curdir());
              strcpy(NewDirectory,NetworkUsername);
              strcpy(NewDirectoryPath, join(3,CurrentDirectory,chr(92),NewDirectory));
              printf("%s\n",NewDirectory);
              printf("%s\n",CurrentDirectory);
              printf("%s\n",NewDirectoryPath);
              mkdir (NewDirectory);
              strcpy(F,findfirst("SGerber.*"));
              strcpy(SourceDirectory,CurrentDirectory);
              strcpy(DestinationDirectory,NewDirectoryPath);
              while(F[0]>0)
              {
              CopyFile (join(2,SourceDirectory,F),join(2,DestinationDirectory,F),FALSE);
              strcpy(F,findnext());
              }

              return 0; /* End of main program */
              }

              Can anyone get this to run?

              Thanks.

              David.


            • David
              ... Thanks.
              Message 6 of 7 , Apr 7 10:37 AM
              View Source
              • 0 Attachment
                --- In BCX@yahoogroups.com, Ad Rienks <ad.rienks@...> wrote:
                >
                > SourceDirectory$ = CurrentDirectory$ + "\"
                > DestinationDirectory$ = NewDirectoryPath$ + "\"
                >
                > 2012/4/7 David <david@...>
                >
                > > **
                > >
                > >
                > >
                > >
                > > --- In BCX@yahoogroups.com, Ad Rienks <ad.rienks@> wrote:
                > > >
                > > > The example on the FINDFIRST$ function page shows how to copy a set of
                > > > files. Simply add a KILL statement in the WHILE ... WEND loop, and you're
                > > > done!
                > > >
                > > > 2012/4/5 David <david@>
                > > >
                > > > > **
                > > > >
                > > > >
                > > > > First of all I'd like to thank everyone who has read and replied to my
                > > > > many recent posts. I'm finding BCX and this forum very helpful.
                > > > > I will have many more questions to ask over the next six months until
                > > my
                > > > > little project is complete, please be patient.
                > > > > Now to my question. Is it possible to move a set of files to another
                > > new
                > > > > directory and then delete the remaining unmoved files in the original
                > > > > directory using BCX functions? There is a copyfile function and a kill
                > > > > function but I have not found a MOVEFILE function. Do I have to rely on
                > > > > passing a DOS command to the operating system to do this?
                > > > > Will Windows 7 even let me do this?
                > > > > I hope there is some way of using copyfile and kill to do the same
                > > thing.
                > > > > Thanks.
                > > > >
                > > > > David.
                > > > >
                > > > >
                > > > >
                > > >
                > >
                > > I've tried this
                > >
                > > DIM F$
                > > DIM CurrentDirectory$
                > > DIM NetworkUsername$
                > > DIM NewDirectory$
                > > DIM NewDirectoryPath$
                > > DIM SourceDirectory$
                > > DIM DestinationDirectory$
                > >
                > > NetworkUsername$ = "abcdefg"
                > > CurrentDirectory$ = CURDIR$
                > > NewDirectory$ = NetworkUsername$
                > > NewDirectoryPath$ = CurrentDirectory$ + "\" + NewDirectory$
                > > ' + "_" + DATE$
                > >
                > > PRINT NewDirectory$
                > > PRINT CurrentDirectory$
                > > PRINT NewDirectoryPath$
                > >
                > > MKDIR NewDirectory$
                > >
                > > F$ = FINDFIRST$("SGerber.*")
                > > SourceDirectory$ = CurrentDirectory$
                > > DestinationDirectory$ = NewDirectoryPath$
                > >
                > > WHILE F$ > ""
                > > COPYFILE SourceDirectory$ + F$, DestinationDirectory$ + F$
                > > F$ = FINDNEXT$
                > > WEND
                > >
                > > It creates a directory called abcdefg beneath the directory where it's run
                > > but it will NOT move any of the files. It makes no difference if I change
                > > the filespec to *.*.
                > > I'm using using BCX version 6.8.6 (2012/02/04)
                > >
                > > Here is the main C function
                > >
                > > int main(int argc, char *argv[])
                > > {
                > > strcpy(NetworkUsername,"abcdefg");
                > > strcpy(CurrentDirectory,curdir());
                > > strcpy(NewDirectory,NetworkUsername);
                > > strcpy(NewDirectoryPath, join(3,CurrentDirectory,chr(92),NewDirectory));
                > > printf("%s\n",NewDirectory);
                > > printf("%s\n",CurrentDirectory);
                > > printf("%s\n",NewDirectoryPath);
                > > mkdir (NewDirectory);
                > > strcpy(F,findfirst("SGerber.*"));
                > > strcpy(SourceDirectory,CurrentDirectory);
                > > strcpy(DestinationDirectory,NewDirectoryPath);
                > > while(F[0]>0)
                > > {
                > > CopyFile (join(2,SourceDirectory,F),join(2,DestinationDirectory,F),FALSE);
                > > strcpy(F,findnext());
                > > }
                > >
                > > return 0; /* End of main program */
                > > }
                > >
                > > Can anyone get this to run?
                > >
                > > Thanks.
                > >
                > > David.
                > >
                > >
                > >
                >
                Thanks.
              Your message has been successfully submitted and would be delivered to recipients shortly.