Always use Copy, Never use Move in ActionScript

In almost all cases, you should use Copy or Copy + Delete in BigFix ActionScript and not Move.

You might think that Copy + Delete is equivalent to Move in ActionScript, but at least in Windows, it is not.

I believe the difference is that a file copied will inherit permissions from the destination folder, while a file moved will not. I assume this means it inherits permissions from the origin folder, but I really don’t know for sure.

I have run into issues where I use the move actionscript command to put a file on the system that all users should be able to read, including non-admins, but because I used the move command, they could not. Generally in my experience this is not the desired behavior unless the file being moved is a log file or something similar that you don’t want most users to be able to read.


Related:


This Post:

Always Use Copy, Never Use Move

3 Likes

This info should probably be noted in the docs / guides.

Though I should probably do a better job of exploring and documenting the specifics beyond just what I remember experiencing.

1 Like

Also reference https://support.microsoft.com/en-us/help/310316/how-permissions-are-handled-when-you-copy-and-move-files-and-folders for the Microsoft explanation of how move vs copy works. We get the same behavior regardless of whether move/copy is performed by BESClient, Windows Explorer, command shell, etc.

There are policies that can be applied to Explorer to modify the behavior. I haven’t tested, but I don’t expect those policies would have an effect on copy/move commands performed by the BES Client or command shell.

1 Like

It is definitely the case that if you are dealing with VERY large files and what you are doing works fine with move, then there are some advantages of doing it that way.