gpt4 book ai didi

php - 通过网络从共享文件中读取数据

转载 作者:行者123 更新时间:2023-11-28 23:23:37 25 4
gpt4 key购买 nike

我的网络共享文件夹中有一些文件,我需要将其内容插入数据库。

\\xxx.xxx.xxx.xxx\SharedFolder\sample.txt

我应该将文件挂载到我的本地目录并从那里读取它,还是我可以从中提取数据并使用一些 php/perl 直接将其放入数据库中 脚本?

如果我选择安装方法,问题是文件在 Windows 操作系统上而不是 Linux 上?

最佳答案

你可以正常打开它:

open my $file, '<', '//xxx.xxx.xxx.xxx/SharedFolder/sample.txt' or die "Oops: $!";

我对此进行了测试,它适用于 Windows。

编写脚本时,您可以(并且应该)在目录路径中使用正斜杠,即使在 Windows 上也是如此。

关于php - 通过网络从共享文件中读取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40399648/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com