我对飞镖/打靶还很陌生,所以让我知道是否有什么可以澄清的。我正在尝试下载文件,但是当我尝试访问它时,出现错误“ FileSystemException:无法打开文件,路径='./data.csv'(操作系统错误:只读文件系统,errno = 30 )“我在做什么错了,我该如何解决?
downloadTextFile() {
HttpClient client = new HttpClient();
client.getUrl(Uri.parse(*I put the link I used here, but it's sort of long*))
.then((HttpClientRequest request) {
return request.close();
})
.then((HttpClientResponse response) {
response.pipe(new File('./data.csv').openWrite());
});
readFileByLines();
}
void readFileByLines() {
File file = new File('./data.csv');
List<String> lines = file.readAsLinesSync();
lines.forEach((l) => print(l));
}
答案 0 :(得分:2)
您可以使用软件包https://pub.dev/packages/path_provider
并将您的文件写入appDocPath
或Directory tempDir = await getTemporaryDirectory();
String tempPath = tempDir.path;
Directory appDocDir = await getApplicationDocumentsDirectory();
String appDocPath = appDocDir.path;
AndroidManifest.xml
对于Android,在<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
中,您可以添加权限
Select * from
(
SELECT
OrderDet.PartNo
,COUNT(OrderDet.PartNo) AS [Number Of Orders]
,SUM(OrderDet.QtyToMake) AS [Total to Make]
FROM
OrderDet
WHERE
OrderDet.Status = 'Open'
AND OrderDet.PartNo = 'SomePartNumber'
GROUP BY
OrderDet.PartNo
) t
JOIN
(
SELECT
SUM(BinLocations.QtyOnHand) AS [Total Available]
,PartNo
FROM
BinLocations
WHERE
BinLocations.PartNo = 'SomePartNumber'
GROUP BY
BinLocations.PartNo
) t1
ON t.PartNo = t1.PartNo;