File Moving and User Concurrency

We have a situation where we want users in an asp.net application to access
the same directory containing image files (tif,jpg,etc). When a user click's
a button, then the next available image in the directory will be moved into
their own personal directory and out of the shared directory. It is critical
that no 2 user's ever have the same file in their personal directory.

User's will not be individually selecting these files, it will simply be the
1st file in the Directory.GetFiles() method of the shared directory.

Is the File.Move method developed in a way that keeps 2 files from being
moved at the same time or does something like SyncLock need to be used in
order to prevent the same file from being copied.

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!