def callback(smb_fs: smbfs.SMBFS): for walk_path in smb_fs.walk.dirs(path, max_depth=1): if (smb_fs.exists(walk_path)): info = smb_fs.getinfo(walk_path) find_data = wintypes.WIN32_FIND_DATAW() find_data.dwFileAttributes = 16 find_data.cFileName = info.name argus[1](pointer(find_data), argus[2]) for walk_path in smb_fs.walk.files(path, max_depth=1): if (smb_fs.exists(walk_path)): info = smb_fs.getinfo(walk_path) filesize = smb_fs.getsize(walk_path) find_data = wintypes.WIN32_FIND_DATAW() find_data.dwFileAttributes = 32 find_data.cFileName = info.name if (len(info.name) >= 11): info_cut = info.name.split(".") cAlternateFileName = info_cut[0][ 0:6] + "~1." + info.suffix[0:3] else: find_data.cAlternateFileName = info.name find_data.ftCreationTime = wintypes.FILETIME() find_data.ftLastAccessTime = wintypes.FILETIME() find_data.ftLastWriteTime = wintypes.FILETIME() find_data.nFileSizeHigh = wintypes.DWORD(0) find_data.nFileSizeLow = wintypes.DWORD(filesize) find_data.dwReserved0 = wintypes.DWORD(0) find_data.dwReserved1 = wintypes.DWORD(0) argus[1](pointer(find_data), argus[2])
def callback(smb_fs: smbfs.SMBFS): nonlocal write_len f = smb_fs.open(file_path, "ab") f.seek(offset, 0) write_len = f.write(byte_for_write) f.close()
def callback2(smb_fs: smbfs.SMBFS): nonlocal read_out f = smb_fs.open(file_path, "rb") f.seek(offset, 0) read_out = f.read(buffer_len) f.close()
def callback(smb_fs: smbfs.SMBFS): nonlocal filesize smb_fs.getsize(file_path)
def callback2(smb_fs: smbfs.SMBFS): smb_fs.removedir(file_path)
def callback(smb_fs: smbfs.SMBFS): smb_fs.remove(file_path)
def callback2(smb_fs: smbfs.SMBFS): smb_fs.create(path)
def callback(smb_fs: smbfs.SMBFS): smb_fs.makedir(path)
def callback(smb_fs: smbfs.SMBFS): nonlocal filesize filesize = smb_fs.getsize(path)
def callback(smb_fs: smbfs.SMBFS): nonlocal is_file if (is_file): smb_fs.move(src_path, dst_path, argus[2]) else: smb_fs.movedir(src_path, dst_path, True)
def callback(smb_fs: smbfs.SMBFS): nonlocal isempty isempty = smb_fs.isempty(path)
def callback(smb_fs: smbfs.SMBFS): nonlocal is_file is_file = smb_fs.isfile(path)
def callback(smb_fs: smbfs.SMBFS): nonlocal is_exists is_exists = smb_fs.exists(path)