very bin官网为什么电脑有网但是网页打不开开了?

首页
\
问答
\
使用shell脚本复制.jpg文件会导致'无法打开文件输入流'错误(Copying .jpg file using shell script gives 'Failed to open input stream for file' error) 非常简单的脚本来复制文件 #!/bin/bash
#copy file
mtp-getfile "6" test2.jpg
我将它设置为可执行文件并使用它运行 sudo sh ./test.sh
它给我一个名为test2.jpg的文件,没有图标,我无法打开我得到一个'无法打开文件输入流'错误
但是,如果我只是从命令行发出以下内容 mtp-getfile "6" test2.jpg
它按预期工作。 我的脚本有什么问题? 我检查并在每种情况下生成的.jpg文件具有相同的字节数。 很奇怪。 Very simple script to copy a file#!/bin/bash
#copy file
mtp-getfile "6" test2.jpg
I set it as executable and run it usingsudo sh ./test.sh
It gives me a file called test2.jpg that has no icon and I cannot open I get a 'Failed to open input stream for file' errorHowever, if I simply issue the following from the command linemtp-getfile "6" test2.jpg
It works as expected. What is wrong with my script? I checked and the resulting .jpg file in each case has the same number of bytes. Very strange.更新时间:2022-08-23 15:08相关问答
更多
您可以使用此代码
通过使用可以实现我想要的: ./mjpg_streamer -i "input_uvc.so -r 1280×1024 -d /dev/video0 -y" -o "output_http.so -p 8080 -w ./www"
...来自mjpg_streamer的目录。 它将通过在使用地址时在浏览器中显示流来为您完成所有令人讨厌的工作:http:// {IP-OF-THE-SERVER}:8080 /它的重量也足以在Raspberry Pi上运行。 这是一个设置它的好教程。 谢谢您的帮助! It i
...
你应该使用$n -lt 5 。 Bash将
正如chepner所评论的那样,你的文件可能有一个DOS(Windows)隐藏行结束于它的名字,这会导致错误。 为了摆脱这些不需要的字符,只需在你的“nix”系统上创建一个新的空白脚本并手工输入名称(而不是通过复制和粘贴,以避免问题),比方说,将其命名为test2.sh。 然后将test.sh的所有内容复制到test2.sh(复制并粘贴)并运行test2.sh并查看它是否有效。 如果没有,请尝试在新脚本上运行以下代码,以确保代码本身没有不需要的字符: tr -d "\r"
php无法直接从客户端系统访问文件。 在这里你试图访问$_FILES['txtfile1']['name']而不是尝试getimagesize($_FILES['txtfile1']['tmp_name']) php can't access files from client system directly. Here you are trying to access $_FILES['txtfile1']['name'] instead try getimagesize($_FILES['txtfile
...
尝试这样来更改文件夹权限, chmod 777 folder_path
参考此链接 try like this to change folder permission, chmod 777 folder_path
refer this link
在你的配置文件或一些常见的文件中定义你的路径如下 define('DOCROOT', $_SERVER['DOCUMENT_ROOT'].'/'); 在你的所有类文件中包含这个常见的php。 然后
$destino= DOCROOT.'Perf_Masc/'.$img; // HERE DOCROOT is defined in config.
In your Config file or some common file define your path
...
拯救! $ ls -1
awk -F. '$2~/^(JPG|MOV)$/{a[$1]++} a[$1]>1{print $1}'
对于存在两个扩展名的情况,将打印没有后缀的文件名。 如果要打印两个文件名,请将最后一个打印块更改为{print $1".JPG"; print $1".MOV"} {print $1".JPG"; print $1".MOV"} ls -1创建文件列表,每行一个文件。 awk -F. 告诉awk使用点作为字段分隔符,以便第二个字段是扩展名。 我们检查第二个字段是否匹配任一
...
找到了解决方案! 特别感谢dan08让我走上了正确的道路。 最终我在这个帖子中找到了答案:将变量传递给从命令行运行的php脚本 我最后使用了该文章中描述的argv []数组,并对脚本进行了一些调整,现在我称之为冠军。 Found a solution! Special thanks to dan08 for getting me set on the right path. Ultimately I found the answer in this thread: Pass variable to php
...
我的猜测是文件行包含空格(例如\r ),要删除它们我们将使用trim() function open_files_from_file_list()
{
$handle = fopen("/home/user/input.txt", "r");
if(!$handle)
return;
while(($line = fgets($handle)) !== false)
{
$line=trim($line);
print $line;
if (!file_exists(
...
}

我要回帖

更多关于 电脑有网但是网页打不开 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信