Search Results

Search found 25343 results on 1014 pages for 'write protect'.

Page 33/1014 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • Need a push in the right direction, to write my first functional test in Rails

    - by Jason
    I've read quiet a bit of documentation over the last few days about testing in Rails, I'm sitting down to write my first real test and not 100% sure how to tie what I have learned together to achieve the following functional test (testing a controller) I need to send a GET request to a URL and pass 3 parameters (simple web-service), if the functionality works the keyword true is simply returned, otherwise the keyword false is returned - its in only value returned & not contained in any <div>, <span> or other tags. The test should assert that if "true" is returned the test is successful. This is probably very simple so apologies for such a non-challenging question. If anyone could point me in the write direction on how I can get started, particularly how I can test the response, I'd be very grateful!

    Read the article

  • Write to pipe deadlocking program

    - by avs3323
    Hi, I am having a problem in my program that uses pipes. What I am doing is using pipes along with fork/exec to send data to another process What I have is something like this: //pipes are created up here if(fork() == 0) //child process { ... execlp(...); } else { ... fprintf(stderr, "Writing to pipe now\n"); write(pipe, buffer, BUFFER_SIZE); fprintf(stderr, "Wrote to pipe!"); ... } This works fine for most messages, but when the message is very large, the write into the pipe deadlocks. I think the pipe might be full, but I do not know how to clear it. I tried using fsync but that didn't work. Can anyone help me?

    Read the article

  • Write data into .txt file created by CFileDialog, in C++

    - by younevertell
    I wanna Write data into .txt file created by CFileDialog, in C++. The problem I am facing is that below codes doesn't work, although there is no build error. The .txt file created by CFileDialog can not be found for some reason. What's wrong the code? what's the efficient way to Write data into .txt file created by CFileDialog, in C++? Thanks CFileDialog dlg(FALSE, NULL, NULL, OFN_OVERWRITEPROMPT, _T("My Data File (*.txt)|*.txt||")); if(dlg.DoModal() != IDOK) return; CString filename = dlg.GetPathName(); ofstream outfile (filename); int mydata = 10; outfile << "my data:" << mydata << endl; outfile.close();

    Read the article

  • write() in sys/uio.h returns -1

    - by fredrik
    I'm using Ubuntu Server 9.10 AMD Phenom 2 cpu g++ (Ubuntu 4.4.1-4ubuntu9) 4.4.1 trying to run the application pftp-shit v 1.11. The following code in tcp.cc is executed successfully: int outfile_fd = open(name, O_CREAT | O_TRUNC | O_RDWR | O_BINARY)) which returns a file descriptor int (in my case 6) - name is a char array containing a valid path to my file which successfully i created. and successfully running: fchmod(outfile_fd, S_IRUSR | S_IWUSR); and access(name, W_OK) The issue occurs during running the function (from sys/uio.h) write(outfile_fd, this-control_buffer, read_length) which returns -1. -1 is of returned if nothing was written and otherwise a non-negative integer is returned which is equal to the number of bytes written. Anyone having a clue how I can get the write function to work?

    Read the article

  • Write to a binary file?

    - by rick irby
    Here is data structure w/ variables: struct Part_record { char id_no[3]; int qoh; string desc; double price: }; --- (Using "cin" to input data) --- Part_record null_part = {" ", 0," ",0.0}; --- --- file.seekg( -(long)sizeof(Part_record), ios::cur); file.write( ( char *)&part, sizeof(Part_record) ); The three variables, qoh, Id_no & price, write out correctly, but the "desc" variable is not right. Do I need to initialize Part_record some other way? It should be 20 characters in length. If you have enough info here, pls share your advice,thanks.

    Read the article

  • How to write Cyrillic text in C++ console?

    - by VextoR
    For example, if I write: cout << "??????!" << endl; //it's hello in Russian in console it would be something like "-?????!" ok, I know that we can use: setlocale(LC_ALL, "Russian"); but after that not working command line arguments in russian (if I start my program through BAT file): StartProgram.bat chcp 1251 MyProgram.exe -user=???? -password=?????? so, after setlocale program can't read russian arguments properly. This happens because BAT file in CP1251, but console is in CP866 So, there is a question: How to write in C++ console russian text and same time russian command line arguments have to be read properly thanks

    Read the article

  • Java Synchronized Write Block

    - by ikurtz
    im new to java and i have a question regarding Synchronized. i have the following code for writing to network (simple implementation for now): public void networkSendData(byte[] data){ try { out.write(data); out.flush(); } catch (IOException e) { } } i was wondering if there is a need for block level Synchronized here as im am writing the whole data at once. or is there a chance for race condition? i ask because the data to write is coming for multiple sources. thank you.

    Read the article

  • write 2d array to a file in C (Operating system)

    - by Bobj-C
    Hello All, I used to use the code below to Write an 1D array to a File: FILE *fp; float floatValue[5] = { 1.1F, 2.2F, 3.3F, 4.4F, 5.5F }; int i; if((fp=fopen("test", "wb"))==NULL) { printf("Cannot open file.\n"); } if(fwrite(floatValue, sizeof(float), 5, fp) != 5) printf("File read error."); fclose(fp); /* read the values */ if((fp=fopen("test", "rb"))==NULL) { printf("Cannot open file.\n"); } if(fread(floatValue, sizeof(float), 5, fp) != 5) { if(feof(fp)) printf("Premature end of file."); else printf("File read error."); } fclose(fp); for(i=0; i<5; i++) printf("%f ", floatValue[i]); My question is if i want to write and read 2D array ??

    Read the article

  • Isolating read and write in multithreaded

    - by the_lotus
    Hi In a multithreaded application. I have a bunch of function that loop through a collection to read the information. I also have a bunch of function that modifies that same collection. I’m looking for a way to isolate all the read and the write together. I don’t want a write to be done while a read is in progress. I was thinking of using SyncLock on the collection object but this will block multiple read trying to work in parallel.

    Read the article

  • how to write to an xml file using flex

    - by Gaurav
    Hi all, I have an application which takes live data from internet, I want to develop another application which reads data from the internet and writes it to an XML file (i.e. I want to save the state in an XML file). THE ONLY THING I NEED IS HOW TO WRITE THIS DATA IN AN XML FILE. FOR EXAMPLE say I have a combo box which takes top 10 fifa world cup watching sites, now I want to write this information (i.e. whatever the data this combo box takes as input into an xml file). I want the answer in flex only. And I don't want answer in AIR. Thankyou in advance.

    Read the article

  • Outlook AppointmentItem Write Event - how many times does it execute

    - by marcincoles
    I need to perform some activity when an appointmentitem (or specifically a meeting) is saved. What I want is once the user has filled in the info and clicks 'send', Outlook does it's stuff and my code executes once. However what I'm finding, is that the Write event occurs multiple times - at least twice, sometimes more (eg in updates). Where this is an issue for me, is that I have an object that needs to be updated before it's serialized, and I don't want to be doing the update and serialization multiple times. Has anyone come across this issue, before and is there a better way to do this to use than appointmentitem.write?

    Read the article

  • Understanding behaviour of read() and write()

    - by neo730
    hi i am a student and just start learning low level c programming.i tried to understand read() and write() methods with this program. #include <unistd.h> #include <stdlib.h> main() { char *st; st=calloc(sizeof(char),2);//allocate memory for 2 char read(0,st,2); write(1,st,2); } i was expecting that it would give segmentation fault when i would try to input more than 2 input characters.but when i execute program and enter " asdf " after giving " as " as output it executes "df" command. i want to know why it doesn't give segmentation fault when we assign more than 2 char to a string of size 2.and why is it executing rest(after 2 char)of input as command instead of giving it as output only? also reading man page of read() i found read() should give EFAULT error,but it doesn't. I am using linux.

    Read the article

  • Write a tree class in Java where each level has a unique object type

    - by user479576
    I need to write a tree class in Java where each level has a unique object type. The way it is written below does not take advantage of generics and causes alot of duplicate code. Is there a way to write this with Generics ? public class NodeB { private String nodeValue; //private List<NodeB> childNodes; // constructors // getters/setters } public class NodeA { private String value; private List<NodeB> childNodes; // constructors // getters/setters } public class Tree { private String value; private List<NodeA> childNodes; // constructors // tree methods }

    Read the article

  • Why won't this piece of my code write to file

    - by user2934783
    I am developing a c++ banking system. I am able to get the float, newbal, values correctly and when I try to write to file, there is no data in the file. else { file>>firstname>>lastname; cout<<endl<<firstname<<" "<<lastname<<endl; cout<<"-----------------------------------\n"; string line; while (getline(file, line)) { //stringstream the getline for line string in file istringstream iss(line); if (iss >> date >> amount) { cout<<date<<"\t\t$"<<showpoint<<fixed<<setprecision(2)<<amount<<endl; famount+=amount; } } cout<<"Your balance is $"<<famount<<endl; cout<<"How much would you like to deposit today: $"; cin>>amountinput; float newbal=0; newbal=(famount+=amountinput); cout<<"\nYour new balance is: $"<<newbal<<".\n"; file<<date<<"\t\t"<<newbal; //***This should be writing to file but it doesn't. file.close(); The text file looks like this: Tony Gaddis 05/24/12 100 05/30/12 300 07/01/12 -300 //Console Output looks like this Tony Gaddis 05/24/12 100 05/30/12 300 07/01/12 -300 Your balance is: #1 How much wuld you like to deposit: #2 Your new balance is: #1 + #2 write to file close file. //exits to main loop:::: How can I make it write to file and save it, and why is this happening. I tried doing it with ostringstream as well considering how I used istringstream for the input. But it didn't work either :\ float newbal=0; newbal=(famount+=amountinput); ostringstream oss(newbal); oss<<date<<"\t\t"<<newbal; I am trying to self teach c++ so any relevant information would be kindly appreciated.

    Read the article

  • psql: FATAL: could not write init file

    - by Leonardo M. Ramé
    as the title points out, I'm getting this error when trying to connect to a PostgreSql database from command line, using PostgreSQL. The client machine is an Ubuntu 11.10 x86_64 and the PostgreSQL libraries are from Version 9.1 Server is PostgreSql 8.3. This is the command that I executed: psql -U postgres -d my_database -h 192.168.0.161 -p 5432 -c "select * from xxyy" I get the same results when I use sudo or su postgres. The sad thing is that I can connect without problems using pgAdmin. Any hint?

    Read the article

  • nginx and php-fpm - Cannot write PHP error log

    - by SteveEdson
    I am using Nginx and PHP-FPM on Linux. I am not sure whether the issue is that PHP is not writing to the location specified in the PHP.ini, or if it just isn't working at all. Some of the logs produced by Nginx and PHP-FPM contain the PHP errors, but they are mixed in with other Nginx log output. When I run phpInfo(), value in the error_log is set to a folder in my home directory, but nothing is ever created. I understand that values in the Nginx conf and PHP-FPM conf can overwrite those set in the PHP.ini, but surely running phpInfo(), would show the final config values? I would like to be able to have 1 folder, with seperate files for the Nginx access and error log as well as PHP errors. Thanks.

    Read the article

  • ASP.Net application can no longer write to DB after having run out of disk space

    - by remi.despres-smyth
    I'm a software developer troubleshooting a sticky problem on a client's production server, and I've got a bit of a problem. They have a virtual server running Windows Server 2008, SQL Server 2008 R1 and IIS7. It was provisioned with two partitions: one that has the OS (~15 Gig), and the other has IIS' web sites (another ~15 Gig). My application that's running this server has been running perfectly well, up until about an hour ago, when it started throwing System.IO.IOException: "There is not enough space on disk". As soon as my client notified me, I cleared up some space on C:\, emptied the recycle bin, and restarted SQL Server and IIS. The web server came back up and the application was running, but it no longer saves information to the database. No error message is coming up, the application can get information out of the DB, but it can no longer save data back to it. I rebooted the server, to no effect. I spoke with a sys admin at the hosting company, and he says SQL Server appears to have come up fine and the database is not in read-only mode. I confirmed that, as I can add records to tables from SQL Server Management Studio. I looked at the event log immediately after trying to save an edited record in the app, and no new events appear in there that I can tell. I'm assuming this is related to having run out of space, as it was all working fine prior to that, but I'm at a bit of a loss as to what exactly needs a kick in the pants to get going again. Can anyone help me out? What the heck is going on here?

    Read the article

  • Cannot read/write FTP directory vsftpd on centos 6.0 (empty folder)

    - by adrianTNT
    I have Centos 6.0 and installed vsftp with YUM, I added a user with Webmin panel, set its home dir to "/var/www/html" and its shell to "/bin/sh", user id is 500, user group is same as name: "adrian_ftp". When I start a ftp program it logs in but the remote folder always shows empty. I set directory owner and group to adrian_ftp:adrian_ftp , no change, I also made them 0777, no change. Any ideas? I tried for over 3-4 hours :|

    Read the article

  • Windows 2003 R2 x86 Mini dump fails to write to disk

    - by Randy K
    I have 3 blade servers that are Blue Screening with a 0xC2 error as far as we can tell randomly. When it started happening I found that the servers weren't set to do provide a dump because they each have 16GB RAM and a 16GB swap file divided over 4 partitions in 4GB files. I set them to provided a small dump file (64K mini dump), but the dump files aren't being written. On start up the server event log is reporting both Event ID 45 "The system could not sucessfully load the crash dump driver." and Event ID 49 "Configuring the Page file for crash dump failed. Make sure there is a page file on the boot partition and that is large enough to contain all physical memory." I understanding is the the small dump shouldn't need a swap file large enough for all physical memory, but the error seems to point to this not being the case. The issue of course is that the max swap file size is 4GB, so this seems to be impossible. Can anyone point me where to go from here?

    Read the article

  • How to write files in specific order?

    - by Bernie
    Okay, here's a weird problem -- My wife just bought a 2014 Nissan Altima. So, I took her iTunes library and converted the .m4a files to .mp3, since the car audio system only supports .mp3 and .wma. So far so good. Then I copied the files to a DOS FAT-32 formatted USB thumb drive, and connected the drive to the car's USB port, only to find all of the tracks were out of sequence. All tracks begin with a two digit numeric prefix, i.e., 01, 02, 03, etc. So you would think they would be in order. So I called Nissan Connect support and the rep told me that there is a known problem with reading files in the correct order. He said the files are read in the same order they are written. So, I manually copied a few albums with the tracks in a predetermined order, and sure enough he was correct. So I copied about 6 albums for testing, then changed to the top level directory and did a "find . music.txt". Then I passed this file to rsync like this: rsync -av --files-from=music.txt . ../Marys\ Music\ Sequenced/ The files looked like they were copied in order, but when I listed the files in order of modified time, they were in the same sequence as the original files: ../Marys Music Sequenced/Air Supply/Air Supply Greatest Hits ls -1rt 01 Lost In Love.mp3 04 Every Woman In The World.mp3 03 Chances.mp3 02 All Out Of Love.mp3 06 Here I Am (Just When I Thought I Was Over You).mp3 05 The One That You Love.mp3 08 I Want To Give It All.mp3 07 Sweet Dreams.mp3 11 Young Love.mp3 So the question is, how can I copy files listed in a file named music.txt, and copy them to a destination, and ensure the modification times are in the same sequence as the files are listed?

    Read the article

  • Windows file locks allowing multiple users to write to open file over network

    - by JPbuntu
    I have 6 windows computers (xp,vista,7) that need to access a samba share (Ubuntu 12.04). I am trying to make it so only one client can open a file at a given time. I thought this was pretty standard behavior of file locks, but I can't get it to work. The way it is right now a file can be open by two users, and changed and saved by either one of them. The last file saved overwrites what ever changes the other user made. At first I thought this was a Samba configuration problem, but I get this behavior even between two windows machines. So far I have only tested: Windows Xp Windows Vista Windows XP Samba << Windows Vista and both give the same behavior. When I tested the Samba configuration, I had set strict locking = yes and get errors logged like this: close_remove_share_mode: Could not get share mode lock for file _prod/part_number_list_COPY.xlsx Eventually all of the files are going to be moved onto the Samba share, so that is the configuration I am most concerned about fixing. Any ideas? Thanks in advance. EDIT: I tested an excel file again, and it is now working properly in both above mentioned cases, I am also no longer getting the above mentioned error. I don't know what happened, perhaps a restart fixed it? (also works with strict locking = no) Although I still need to find a solution for the CAD/CAM files we use, the software is Vector and it does not seem to be using file locks. Is there any software that I can use to manage these files, so two people can't open/edit them at a time? Maybe a windows application that forces file locks? Or a dirt simple version control system? (the only ones I have seen at are too complicated for our needs).

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >