Fifth FAQ

for

Project 3 -- POSIX Files, Directories, and Permissions

Q. Well, while we're at it... We arn't supposed to do anything with groupid, right? I'm 99.999% sure we arn't, but hearing it from the source would be better, and it couldn't hurt to be in the faq.

A. That's right, you don't need to worry about group ID for this project.


Q. I'm confused about the description for teamsync..

The description mentions that files and directories being copied from should be owned by the owner of the teamsync executeable and files and directories being copied to should be owned by the user running teamsync. And if these conditions aren't met, the program doesn't sync the files.

The description, however, says that it should run like fssync, so should the files also be copied in the other direction?

For example:
If I am user1 and I ran teamsync owned by user2, user2's files and directories will be copied to my teamsyncdir. But should my files, user1, be copied to user2's teamsyncdir also?

If this is not the case, and I should only copy in one direction, then should I set up the parameters for the program so that the first path is always copied from and the second path is always copied to?

A. The directionality described for teamsync is intentional and should be reflected in your program. Think of it this way: If you want to have the latest updates that one of your team members has made to his or her files, you'd run his or her copy of teamsync and you'd get his or her updated files. However, by running teamsync, you won't force your changed files on your teammate -- maybe he or she doesn't want them. If your teammate does want to get the latest copies of the files that you have changed, he or she can run your copy of teamsync.

So, in your example, when you (user1) run user2's teamsync, you (user1) should get copies of user2's latest files, but your files (user1's files) should not be copied to user2.

As for the order of the arguments on the command line when teamsync is run, no, you should not enforce an order on them so that the first path is always copied from and the second path is always copied to (or vice versa). Instead, your program ought to check the conditions listed in the assignment each time that it goes to copy a file.