Questions tagged [createfile]

The Windows CreateFile API function

The Windows CreateFile API function.

Use this tag only in conjunction with the windows-specific API. Do not use this tag if you intend to refer to the generic concept of referring to a file.

474 questions
2
votes
1 answer

CreateFile fails on opening lsass.exe

I'm working on a program, which collects some statistics about processes, which are running on the system. I've got a code, which retrieves some routine information, such as executable file version, publisher and so on. The code works fine for me…
2
votes
3 answers

Append text at the end of a text file in win32 api

I am trying to open a text file, write some data into it and then append some more data at the end of the data already written to the file, but this doesnot work. Can anybody help me figuring out the problem with my code? CODE SNIPPET: char…
Ayse
  • 2,676
  • 10
  • 36
  • 61
2
votes
2 answers

Text File created by CreateFile() function is not displayed

I am trying to open a text file. if the file does not exists, then it must be first created and opened. I have written the following piece of code for this purpose. The code works fine, it also creates file inside BIN folder but still I cannot see…
Ayse
  • 2,676
  • 10
  • 36
  • 61
2
votes
1 answer

powershell create multiple files from csv with specific content

So, the problem is that I must create a 300 ini files. In CSV file I have a computer names and MAC addresses. Ini files must be named as MAC addresses. For that I have solution: $data = Import-CSV d:\import.csv ForEach ($i in $data){ $name =…
2
votes
1 answer

CreateTextFile not working when hta is set to open as notepad by default (javascripting)

I'm getting this really weird problem when I try to create a text file using javascripting and a hta file. This is the code broken down to its basics:
user1908658
  • 75
  • 1
  • 7
2
votes
0 answers

C# Access Disk Drive as UNC Path (Windows 8)

I have a function that I'm trying to get working. My intention is to be able to get a file handle (IntPtr) object so that I can call "Win32.DeviceIoControl" against it. It works just fine in Windows 7, however when I test on Windows 8, I'm getting a…
Trihedron
  • 246
  • 2
  • 14
2
votes
1 answer

dos assembly can't write file

I wrote a 16 bit .com file which create a file but it don't create any file. I tried on windows 7 32 bit. and inside dosbox. the source code is here how can I write to a file? org 100h call open_new_file mov ah, 40h;write …
kim taeyun
  • 1,837
  • 2
  • 24
  • 49
2
votes
2 answers

How can I create text files with special characters in their filenames

Demonstration of my problem Open a new Excel workbook and save these symbols 設計師協會 to cell [A1] insert the following VBA code somewhere in the editor (Alt+F11) execute it line per line (F8) Sub test() strCRLF = StrConv(vbCrLf, vbUnicode) …
nixda
  • 2,654
  • 12
  • 49
  • 82
2
votes
2 answers

where is myfile after createNewFile()

Possible Duplicate: Where will be create a new file in java, when path is not given? I am trying to create a txt file in the current directory. I ran the code below and there was no error. But I couldn't find the myfile.txt anywhere. I want to…
kaboom
  • 833
  • 4
  • 18
  • 38
2
votes
1 answer

How do I open a file named .txt with CreateFile() API function?

Code points of some Unicode characters (like ) consume more than 2-bytes. How do I use Win32 API functions like CreateFile() with these characters? WinBase.h WINBASEAPI __out HANDLE WINAPI CreateFileA( __in LPCSTR lpFileName, __in …
hkBattousai
  • 10,583
  • 18
  • 76
  • 124
2
votes
1 answer

Setting the last-modified-time of a directory opened for ReadDirectoryChangesW

I hava a Java program that needs to monitor a directory tree for changes. I have JNI code that uses ReadDirectoryChangesW(). The directory is opened like: HANDLE dirHandle = CreateFile( path, FILE_LIST_DIRECTORY, FILE_SHARE_READ |…
Paul J. Lucas
  • 6,895
  • 6
  • 44
  • 88
2
votes
0 answers

Intent on file create or delete?

I want to implement search functionality in my file manager on android. So what I am trying to do is store all the file paths in my application database, and query from there. But the problem is after initializing the database with file's path, if…
sanjeev
  • 1,343
  • 3
  • 16
  • 28
2
votes
1 answer

CreateFile doesn't prevents other processes from opening my device

I'm using CreateFile to open a connection to my USB hardware. If I have two (or more) hardwares connected to the PC I would like to prevent several instances (different PIDs) of my PC-application to connect to the very same hardware. I thought this…
user872661
  • 251
  • 2
  • 13
1
vote
0 answers

Command Line: Create File Named With Date/Time

I have seen questions of these sorts listed on the site, and I've tried to work through them but haven't been successful. What I want to do is make .bat file that creates a file (probably just a txt file, but doesn't matter) which has the Date and…
1
vote
3 answers

Readfile async - iso files c++

In my c++ application I'm rying to read iso file asynchronous by createfile - with overlapped flag and after it - readfile. however when I try this code on a simple file (txt file for example) it works. but when I run this code on iso file - it…
gln
  • 1,011
  • 5
  • 31
  • 61