# ftptrainees haven't access to holding, use a temp directory instead
if not os.access(self.holding_dir, os.W_OK):
self.holding_dir = Config()["Dir::TempPath"]
# ftptrainees haven't access to holding, use a temp directory instead
if not os.access(self.holding_dir, os.W_OK):
self.holding_dir = Config()["Dir::TempPath"]
def copy_to_holding(self, filename):
base_filename = os.path.basename(filename)
dest = os.path.join(self.holding_dir, base_filename)
try:
def copy_to_holding(self, filename):
base_filename = os.path.basename(filename)
dest = os.path.join(self.holding_dir, base_filename)
try:
# Shouldn't happen, but will if, for example, someone lists a
# file twice in the .changes.
if e.errno == EEXIST:
# Shouldn't happen, but will if, for example, someone lists a
# file twice in the .changes.
if e.errno == EEXIST:
# In either case (ENOENT or EACCES) we want to remove the
# O_CREAT | O_EXCLed ghost file, so add the file to the list
# of 'in holding' even if it's not the real file.
# In either case (ENOENT or EACCES) we want to remove the
# O_CREAT | O_EXCLed ghost file, so add the file to the list
# of 'in holding' even if it's not the real file.