def paste_symlink(self, relative=False): copied_files = self.copy_buffer for f in copied_files: self.notify(next_available_filename(f.basename)) try: new_name = next_available_filename(f.basename) if relative: relative_symlink(f.path, join(getcwd(), new_name)) else: symlink(f.path, join(getcwd(), new_name)) except Exception as x: self.notify(x)
def paste_symlink(self, relative=False): copied_files = self.copy_buffer for f in copied_files: self.notify(next_available_filename(f.basename)) try: new_name = next_available_filename(f.basename) if relative: relative_symlink(f.path, join(getcwd(), new_name)) else: symlink(f.path, join(getcwd(), new_name)) except Exception as x: self.notify(x)
def paste_hardlink(self): for f in self.copy_buffer: try: new_name = next_available_filename(f.basename) link(f.path, join(getcwd(), new_name)) except Exception as x: self.notify(x)
def paste_hardlink(self): for f in self.copy_buffer: try: new_name = next_available_filename(f.basename) link(f.path, join(getcwd(), new_name)) except Exception as x: self.notify(x)
def paste_hardlink(self): for fobj in self.copy_buffer: new_name = next_available_filename(fobj.basename) try: link(fobj.path, join(getcwd(), new_name)) except OSError as ex: self.notify('Failed to paste hardlink: View log for more info', bad=True, exception=ex)
def _recurse_hardlinked_tree(self, source_path, target_path): if isdir(source_path): if not exists(target_path): os.mkdir(target_path, stat(source_path).st_mode) for item in listdir(source_path): self._recurse_hardlinked_tree(join(source_path, item), join(target_path, item)) else: if not exists(target_path) or stat(source_path).st_ino != stat(target_path).st_ino: link(source_path, next_available_filename(target_path))
def _recurse_hardlinked_tree(self, source_path, target_path): if isdir(source_path): if not exists(target_path): os.mkdir(target_path, stat(source_path).st_mode) for item in listdir(source_path): self._recurse_hardlinked_tree(join(source_path, item), join(target_path, item)) else: if not exists(target_path) \ or stat(source_path).st_ino != stat(target_path).st_ino: link(source_path, next_available_filename(target_path))
def paste_symlink(self, relative=False): copied_files = self.copy_buffer for fobj in copied_files: new_name = next_available_filename(fobj.basename) self.notify(new_name) try: if relative: relative_symlink(fobj.path, join(getcwd(), new_name)) else: symlink(fobj.path, join(getcwd(), new_name)) except OSError as ex: self.notify('Failed to paste symlink: View log for more info', bad=True, exception=ex)