Part of the solution, if there may be multiple instances of the same script running, may be to maintain a lock file that mediates allocation of file names.
Possibly store the name and a next number for each used file. The atomic access to the lock file then adds a new name or increments the count on an existing name and in the process generates the name to be used.
In reply to Re: How to move/copy a file without overwriting an existing file
by GrandFather
in thread How to move/copy a file without overwriting an existing file
by bart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |