write

Writing to Notepad wraps at arbitrary point?

Hi, I'm writing to a file as shown below. I am ONE HUNDRED % SURE there are no line breaks in the variables being written to the file. However, at an arbitrary character count in every line printed to Notepad of applicable length, a line break is created. However, pressing delete at the end of the file (even holding delete) to get rid of...

Find and check if negative write

Hello, i'm creating a batch file and just a little thing i want to know: my (WINDOWS) batch file needs to search 'hello' in a text file. If it is there, it should use the GOTO command to somewhere else in the batch file. If it isn't there, it should write 'hello' on a new line. How can you do that? I know that you can use FIND and ...

Is there any good open-source software to write test cases?

I'd like to have historical memory of the test cases I usually do to verify a software suite, and the company in which I work now uses word or excel docs for this task, but I'd like something more focused on the type of task. What do you use? Is there any open-source software to fill with test cases? Thanks ...

C#, Win CE 4.2, Write file, power loss

Hello programmers, I'm using C# & the compact framework on an embedded device to log data to a compact flash card. Because data integrity is of upper most importance, I'm wondering how to write the data to the flash disk. Will files get lost/damaged if power is lost during a write/flush or while the file is opened? What's the best way t...

write() to stdout and printf output not interleaved?

#include <stdio.h> #define MAXLEN 256 int main() { int n; char buf[MAXLEN]; while((n = read(0,buf,sizeof(buf))) != 0){ printf("n: %d:",n); write(1,buf,n); } return 1; } The output of the program is read read write write n: 5:n: 6: The output of printf comes after pressing Ctrl+D at the standard input and not alon...

Permissions set to 777 and file still not writeable

I have set file permissions to 777 yet I cannot write to the file with PHP. I can clearly see in my FTP client that the file has 0777 permissions and when I do: echo (true === is_writable('file.txt')) ? 'yes' : 'no'; I get 'no'; I also tried: echo (true === chmod('file.txt', 0777)) ? 'yes' : 'no'; With the same result. The direc...

create ini file, write values in PHP

I cannot find a way that easily lets me create a new file, treat it as an ini file (not php.ini or simiilar... a separate ini file for per user), and create/delete values using PHP. PHP seems to offer no easy way to create an ini file and read/write/delete values. So far, it's all just "read" - nothing about creating entries or manipulat...

Writing file to web server - ASP.NET

Hello all... I simply want to write the contents of a TextBox control to a file in the root of the web server directory... how do I specify it? Bear in mind, I'm testing this locally... it keeps writing the file to my program files\visual studio\Common\IDE directory rather than my project directory (which is where I assume root is when...

Beginner Java (Help with class assignment)

This is a lab I am working for for a CSE 201. The program is supposed to read information about students and their scores from a file, and output the name of each student with all his/her scores and the total score, plus the average score of the class, and the name and total score of the students with the highest and lowest total score. ...

Vim: write back my file on each key press

I'd like vim to automatically write my file as often as possible. The ideal would be every keystroke. I need to save regularly so that my background build process will see it. It's a makefile for a latex document, and I'd like the previewer to show me a nearly up-to-date document when I'm finished typing. Eventual answer (the answers b...

Fortran runtime error "fixed" by writing output

Hi! I've having trouble with some old code used for research that I would like to compile using the Intel Fortran compiler. In a particular subroutine, I get segmentation faults unless I add in a write statement that just outputs the value of the loop index. do j=1,ne SOME STUFF write(*,*) 'j=', j end What could be causing my erro...

How to get a pointer to the beginning of a file in C++

Hi Is it possible in C++ to somehow get a pointer to the beginning of an opened file so that it ( the pointer ) can be passed to the unix write function together with the size of the file? Just to be clear: I want to pass the whole file to a write-like function - how do I do this? ...

"WindowsError: exception: access violation..." - ctypes question

Howdy all - Here is the prototype for a C function that resides in a DLL: extern "C" void__stdcall__declspec(dllexport) ReturnPulse(double*,double*,double*,double*,double*); In another thread, I asked about how to properly create and send the necessary arguments to this function. Here is the thread: http://stackoverflow.com/question...

(Java) Write decimal/hex to a file, and not string

If I have a file, and I want to literally write '42' to it (the value, not the string), which for example is 2a in hex, how do I do it? I want to be able to use something like outfile.write(42) or outfile.write(2a) and not write the string to the file. (I realize this is a simple question but I can't find the answer of google, probably ...

Java concurrency file system

Good day, I need to create a File System Manager (more or less) which can read or write data to files. My problem is how do I handle concurrency? I can do something like public class FileSystemManager { private ReadWriteLock readWriteLock = new ReentrantReadWriteLock(); public byte[] read(String path) { readWriteLo...

Use web interface to modify htaccess file

The solution to a previous question (How to implement “Maintenance Mode” on already established website), was to use a modified .htaccess to deny IP addresses. What is the best way to use a web interface to modify an .htaccess file? What I want is a way for an admin to log in to the admin area and switch Maintenance Mode on and off usi...

How do I write to shared memory in C++?

I'd like to write to shared memory and then dump the contents to a file in the win32 api. Currently I have this code: HANDLE hFile, hMapFile; LPVOID lpMapAddress; hFile = CreateFile("input.map", GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); hMapFile = CreateFileMapping(hFile, N...

Writing to shared memory

How can I write from a file to shared memory using the Win32 API? I have this code: hFile = CreateFile("input.map", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); hMapFile = CreateFileMapping(hFile, NULL, PAGE_READWRITE, 0, 0, TEXT("SharedObject")); lpMapAddre...

Ant, (over)write into a file

How to write (or overwrite) the following contents: <dependencies> <dependency> <groupId>ged.eprom</groupId> <artifactId>epromx</artifactId> <version>${version.to.set}</version> <classifier>stubjava</classifier> </dependency> </dependencies> into file called pom.xml in the current directory. I have tried...

problem of entering text in combobox created by using <sx:autocompleter>

im trying to use autocompleter tag for displaying autosugget in my application,but with the following code i am not able to write in the combo box but has a populated list which is displayed when down arrow image(along with the combo box) is pressed. <sx:autocompleter list="state" name="StateName" list="{'CA','TR','GP','CL'}" searchT...