[python] 디렉터리 내에서 원하는 파일 개수만큼 옮기기
·
파이썬
import os import shutil path = "/ssd/crack/data/concretecrack/" file_lst = os.listdir(path) print(file_lst) count=0 num = 83124 for file in file_lst: if(count < num): dir = '/ssd/crack/data/val/' shutil.move(path + file, dir + file) print(file) count = count + 1 else: break - path = 옮길 파일들이 있는 경로 - num = 옮기고 싶은 파일의 개수 - dir = 파일들이 옮겨질 장소
[c#] FTP에서 디렉토리(Directory)와 파일(File) 불러오기
·
c#
💡 디렉토리와 파일을 구분하는 방법? 불러온 주소를 다시 덧붙여서 하위 디렉토리가 있는지 검사 → 하위 파일이나 디렉토리가 없는 경우, 검사하기 어려움 파일 접근 권한에 ‘d’가 붙은 지 검사 using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; namespace loadingFtp { internal class Class1 { public static void Main(String[] args) { Uri ftpUri = ..