fopen-无法打开流:权限被拒绝 [英] fopen - failed to open stream: Permission denied

查看:93
本文介绍了fopen-无法打开流:权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从桌面打开文件时是否可以将数据写入 CSV ?因为当用户提交表单时,我试图将某些输入数据写入 CSV ,但是当从桌面上打开文件时,却遇到了以上错误.关闭文件后,我的系统才会写入csv.

Is it possible to write data to CSV while the file is opened from desktop? Because I am trying to write some input data to CSV when user submit the form, but I am getting above error when the file is opened from my desktop. My system will only write to csv when I close the file.

遇到行 $ fp = fopen("C:\ Users \ lenovo \ Desktop \ sample.csv","w");

推荐答案

通过在文件所在文件夹的终端上使用以下命令来更改文件sample.csv的权限-

Change the permission of the file sample.csv by using the following command on the terminal in the folder where the file is-

chmod 777 sample.csv

这篇关于fopen-无法打开流:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆