Deleting files on remote server via python script indicated as hidden - Stack Overflow

I have a Python script that initiates deletion of files in a folder on a remote SFTP server.The deleti

I have a Python script that initiates deletion of files in a folder on a remote SFTP server. The deletion is indicated in the log. Upon check on the remote directory and when I list with ls I get empty line and no files present:

sftp> cd PATH/
sftp> ls
sftp>

However when I list with ls -al:

sftp> ls -al
drwxrwxr-x    2 6055     6052         4096 Nov 20 05:23 .
drwxrwxr-x    4 6055     6052         4096 Oct 24 11:07 ..
-rw-r--r--    1 6055     6052         6742 Nov 15 20:10 .file1.csv
-rw-r--r--    1 6055     6052         6742 Nov 18 19:23 .file2.csv
-rw-r--r--    1 6055     6052         6743 Nov 19 19:21 .file3.csv
-rw-r--r--    1 6055     6052         7179 Nov 15 18:52 .file4.csv
-rw-r--r--    1 6055     6052         7178 Nov 18 18:03 .file5.csv
-rw-r--r--    1 6055     6052         7182 Nov 19 18:03 .file6.csv

The files listed using ls -al all begin with a . (dot), indicating that they are hidden files. The default ls command in SFTP does not show hidden files. Does it mean that I need to modify the script to include hidden files in the deletion process? Or are they indeed deleted /masked as deleted and won't be copied/transferred from other scripts?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742353541a4427988.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信