Announcement

Collapse
No announcement yet.

Bug in the File Copy / Move functions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug in the File Copy / Move functions

    Hello ,

    Have been doing some simple File Movements with Autoplay and notice that in combination with [hidden] attribute when move/copy normal files it will append the [S] and sometimes even [H] attributes to the File.

    not sure what causes this but if you try to loop through and totally [move] all files from a folder with no sub-folders it will also delete the folder being [moved] from if it does not have any sub folders luckily.

    cheers.

  • #2
    yeah ok , so ... well?.. problem was the trailing ""'s on some paths.. 'vs' to slash..
    also " " spaces can provide unwanted File.Attributes.

    if path = this\path\
    & file = thisfile.exe
    and you use newPath = path.."\"..file

    it will add an extra \ between path and file..

    this "" can add some interesting FileAttributes

    thanks.

    Comment


    • #3
      Hi,

      I'm having trouble understanding/replicating the situation you described where a system and hidden attribute would/could be written to the destination file. Could you provide an example script that could be used to replicate the issue?

      Comment


      • #4
        Hi Darryl , Ill dig through the code later today and post it up. was an odd instance where i made a dimple filemanager and loaded a directory into a table and into a ListBox. then using a button I copied the files from one folder to another. I worked out that it was because some paths did not have a trailing slash and others did.. which was defined elsewhere.

        you could try copy/move opperations with double // which will likely replicate the issue so probably more likely my coding then anything.

        Comment


        • #5
          In my tests, the existence or not of a trailing destination double backslash (assuming that's what you meant, versus forward slash) didn't make any difference. So it doesn't look like that was the issue, or at least alone. So if you have a simple script that can be used to replicate the issue it would be helpful in determining whether or not a bug in AMS exists or not.

          Comment


          • #6
            Hi Darryl , Sorry for delay , please find attached a demo of the bug Iam trying to explain.
            Attached Files

            Comment


            • #7
              sorry setup 2 folders in the projects _SourceFolder Directory named COPY and MOVE
              chuck some files into the Copy Folder and then press the copy button after adding a trailing <backslash> to the copy input box
              have attached a compressed version below with these files etc..
              Attached Files

              Comment


              • #8
                The problem appears if/when you have a path like so: c:\myDirectory\\myFile.exe

                this extra <

                Comment


                • #9
                  > backslash seems to cause some interesting results whne using the copy.move functions within AMS.

                  Comment


                  • #10
                    scenarios where there could happen is if the user is given the opportunity to enter in a source/destination path for files to be copy/moved from/to
                    if the user inadvertantly adds a trailing slash to either path then this could cause the random attributes scenario to occur. I rectified this my side by creating a path_parser or sorts which would either append the "" to the end of the path or remove it if found from any paths input.

                    because when concatenating the filename to the path ie; "c:\..filename.exe" could become c:\\filename.exe which then appends these attributes. I think that you should get the jist of it by now. As I think it all comes back to the extra "" which is causing these unwanted results. And if used with the move function well it totally deletes the folder as well ?!?!

                    Comment


                    • #11
                      for some reason these forums don't like the backslash char in certain regards so if you just 'imagine' that when you see "" that really there is a backslash encompassed between the quatation marks.. ie; "<backslash>" also the download counter for files appears to be broken in these forums.

                      Comment


                      • #12

                        a .gif showing these effects ..

                        Comment


                        • #13
                          Thanks for the example project, it does explain the behavior you described.

                          Comment


                          • #14
                            not a problem, glad i could help.

                            Comment

                            Working...
                            X