createfile

How to create file directories and folders in Android data/data/project filesystem

五迷三道 提交于 2019-12-31 10:44:11
问题 I am working on a video editor program and am fairly new to android and java. What I would like to happen is when the user presses "create new project" button, a dialog pops up asking the user for the name of the project. I have that part down, but what I then want, is when the user presses "ok" on that dialog, my code will take the name and create a directory inside of my data/data file for my project and inside of that directory create folders titled 1 to 5 or more. I really don't know how

How to create file directories and folders in Android data/data/project filesystem

爷,独闯天下 提交于 2019-12-31 10:42:49
问题 I am working on a video editor program and am fairly new to android and java. What I would like to happen is when the user presses "create new project" button, a dialog pops up asking the user for the name of the project. I have that part down, but what I then want, is when the user presses "ok" on that dialog, my code will take the name and create a directory inside of my data/data file for my project and inside of that directory create folders titled 1 to 5 or more. I really don't know how

Creating csv file using java [closed]

99封情书 提交于 2019-12-25 19:39:44
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I'm currently working on creating a csv file in Java. I have the below code but doesn't seem to work. String newFileName = "Temp" + fileName; File newFile = new File(newFileName); I don't know what else to do. Do

Windows CreateFile slow when opening a large number of files

不想你离开。 提交于 2019-12-25 17:46:41
问题 I am using a directory that has about 3000 files. I am aware of the NTFS threads that have talked about CreateFile being slow for reading files in the quantity of 100,000s or millions. My number isn't nearly that high yet it still takes about 4-7 ms for CreateFile to complete which adds up when I'm opening 3000 files. So my problem is similar to the post below. On some machines it is lightning fast when I invoke CreateFile and then on other ones it is this 4-7 ms speed. I've tried Fat32

Reading a File while it is being written by another process

一曲冷凌霜 提交于 2019-12-23 09:38:55
问题 I'm trying to read binary data from a buffer file which is continuously written to by a different process (that I cannot modify). I'm using the following code in order to open the file: fileH = CreateFileA((LPCSTR)filename, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); And it opens correctly with no error. However, when I read data from the file, it seems to block the other process from writing to the file since I loss data. The buffer is

CreateFile() returns INVALID_HANDLE_VALUE but GetLastError() is ERROR_SUCCESS

跟風遠走 提交于 2019-12-23 08:30:10
问题 I am opening a serial port using CreateFile(). I've got a testcase (too complicated to redistribute) that consistently causes CreateFile() to return INVALID_HANDLE_VALUE and GetLastError() to return ERROR_SUCCESS . By the looks of it, this bug only occurs if one thread opens the port at the exact same time that another port closes it. The thread opening the port runs across this problem. I don't know if this makes a difference, but later on in the code I associate the port with a

CreateFile() returns INVALID_HANDLE_VALUE but GetLastError() is ERROR_SUCCESS

血红的双手。 提交于 2019-12-23 08:30:02
问题 I am opening a serial port using CreateFile(). I've got a testcase (too complicated to redistribute) that consistently causes CreateFile() to return INVALID_HANDLE_VALUE and GetLastError() to return ERROR_SUCCESS . By the looks of it, this bug only occurs if one thread opens the port at the exact same time that another port closes it. The thread opening the port runs across this problem. I don't know if this makes a difference, but later on in the code I associate the port with a

SetFilePointer without FILE_FLAG_NO_BUFFERING

微笑、不失礼 提交于 2019-12-23 04:20:59
问题 Consider this program: #include <stdio.h> #include <windows.h> int main(int argc, char** argv) { if (argc != 2) return 1; HANDLE j = CreateFile("\\\\.\\F:", FILE_GENERIC_READ, FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_SYSTEM, NULL); int k = SetFilePointer(j, atoi(argv[1]), NULL, FILE_BEGIN); printf("%d\n", k); } I am getting these results: > a 512 512 > a 513 -1 > a 1024 1024 So I can only move the file pointer in multiples of the volume sector size. This is the behavior that

C++ CreateFile does not found .txt file in same folder as .exe [closed]

只愿长相守 提交于 2019-12-22 09:39:17
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I'm trying to use CreateFile function, but it does not go as planned. I did a simple test code : #include <Windows.h> #include <iostream> #include <tchar.h> using namespace std; int main() { HANDLE hFile; hFile = CreateFile(_T("test.txt"), GENERIC_READ, NULL, NULL, OPEN_EXISTING, NULL, NULL); if (hFile ==

Dokan虚拟磁盘开发实战

六月ゝ 毕业季﹏ 提交于 2019-12-21 16:44:49
因工作需要,最近与同事合作使用Dokan开发了一个虚拟磁盘的简单程序,初步实现了远程目录映射到本地虚拟磁盘的功能。 远程服务端是用Python写的,主要是将远程主机上的目录文件传给客戶端,在这里就不细说了。 Dokan客户端则由Delphi开发,其参考代码来自网络上的Delphi例子,比如 Mirror Driver 。 本篇文章主要是Dokan开发过程的一些总结,所以不会对Dokan本身做介绍,与Dokan有关的资料及代码,请到google里搜索,或到Dokan的官方网站去下载( Dokan官网 ),源码是C语言的,应用例子有Ruby、.Net及C的。如果想要Delphi的例子代码,只能自己去找了。 刚开始时由于不清楚如何用Dokan来实现一个文件系统,所以需要做一些试验,结果一不小心就蓝屏了!悲剧啊,用XP系统已经好多年没遇到蓝屏了。几次蓝屏之后,终于受不了了,于是在VMWare里装了个虚拟机的XP,这下不怕蓝屏了,哈哈。强烈建议装个虚拟机来玩Dokan,否则刚开始的时候你会蓝屏N次! 为简单起见,我做的Dokan虚拟磁盘采用将远程目录缓存到本地目录的方法来实现,这样就不用自己维护一堆目录、文件的信息,只需要关注如何更新同步目录与文件就可以了。由于Dokan是多线程的,因此实现时需要做到线程安全;查看Dokan使用的结构类型,发现只有两个成员可以使用,即DOKAN