Is there a way to remove a line from the end of a .txt file from Objective-C? I can't seem to find anything on manipulating text files from Objective-C, only reading them into a NSString.
Hi, I am working on a project and I need to save user configuration. The configuration is a set of Jchechboxes I need to store their state (true, false). Which do you think is the better way of saving it, in a file and if yes in what (ini, cfg, txt), or it is better to serialize the object with the states?? Or if there is another way, please tell me :)
Cheers
how can I change file/folders permissions on Microsoft IIS ?
Should I use icacls ? Can I use it from ftp ? I'm currently logged in with Microsoft ftp protocol but I get:
ftp> icacls
?Invalid command.
What's the equivalent of
ls -l (to see the permissions)
and
chmod -R folder +arwx
thanks
I am trying to upload file using zend frame work but have not been successful. I have read Akras tutorial, which was helpful but when i used those techniques in my project I was not able to get it to work.
Hi guys,
I have a question about the JFileChooser in Swing. I'm trying to get multiple file extensions in the drop-down box, but have no idea how to do it.
There is the method
extFilter = FileNameExtensionFilter(description, extensions);
that I can then use by writing
fileChooser.setFileFilter(extFilter);
however, as you can see, this only supports one option in the drop-down list. How do I add more?
How can I check the existence of a windows service in a batch file?
The user is inputing a service name and I want to check that the service does exist before continuing with my script.
I need to create a batch file that goes to a directory and execute a series of executables
start cd c:\temp\
command1
command2
the above doesn't work, it only starts in c:\temp, but ignores rest.
Hi,
Our site is currently set to pass all files with the xml file extension through the asp.net worker process because all the xml files on the site at the moment are generated dynamically on being hit, by writing the output directly into the response stream.
However we now have a requirement to add a file which is much larger and takes several minutes to generate in this way. I wrote a console app to generate the file and set it to run nightly, but because of the global IIS setting directing xml files to run through asp_wp, it's not being served properly.
I can't seem to find a way to make an exemption for the treatment of a single file in the IIS settings. Is there any other way we can do it?
Cheers,
Matt
I have a plain text file with words, which are separated by comma, for example:
word1, word2, word3, word2, word4, word5, word 3, word6, word7, word3
i want to delete the duplicates and to become:
word1, word2, word3, word4, word5, word6, word7
Any Ideas? I think, egrep can help me, but i'm not sure, how to use it exactly....
Is there a WMI namespace and a class that can be used to obtain the extended properties of a file, such as Owner, Author, Title, Subject, Category, Comments?
please suggest.
Yes, There's More Than One Way To Do It™, but what is the most canonical, most efficient, and most concise methods to read an entire file into a string? (The latter two are perhaps at odds.)
I need to be able to download some file from a regular site using my proxy server,
I already try this:
System.Net.WebClient client = new System.Net.WebClient();
client.Proxy = new WebProxy(ip, port);
client.DownloadFile(url);
but it's not works at all, I don't know what I missed,(without a proxy it works)
thanks,
Dani.
I am a unclear about file system implementation. Specifically (Operating Systems - Tannenbaum (Edition 3), Page 275) states "The first word of each block is used as a pointer to the next one. The rest of block is data".
Can anyone please explain to me the hierarchy of the division here? Like, each disk partition contains blocks, blocks contain words, and so on...
Say I have file A, in middle of which have a tag string "#INSERT_HERE#". I want to put the whole content of file B to that postion of file A. I have tried using pipe to concatenate those contents, but I'm wondering if there is more advanced one-line script to handle it.
Thanks.
I have a file and I don't know how big it's going to be (it could be quite large, but the size will vary greatly). I want to search the last 10 lines or so to see if any of them match a string. I need to do this as quickly and efficiently as possible and was wondering if there's anything better than:
s = "foo"
last_bit = fileObj.readlines()[-10:]
for line in last_bit:
if line == s:
print "FOUND"
I didn't think this was going to be hard. I have a commmand file, d:\a.cmd which contains:
copy /b d:\7zS.sfx + d:\config.txt + d:\files.7z d:\setup.exe
But this line of C# wont' execute it:
Process.Start("d:\\a.cmd");
Throws Win32Exception: "%1 is not a valid Win32 application."
Process.Start opens .pdf files...why not execute command files?
Thanks in advance,
Jim
We can replace strings in a batch file using the following command
set str="jump over the chair"
set str=%str:chair=table%
These lines work fine and change the string "jump over the chair" to "jump over the table". Now I want to replace the word "chair" in the string with some variable and I don't know how to do it.
set word=table
set str="jump over the chair"
??
Any ideas?
I want to throw the last three character from file name and get the rest?
I have this code:
char* remove(char* mystr) {
char tmp[] = {0};
unsigned int x;
for (x = 0; x < (strlen(mystr) - 3); x++)
tmp[x] = mystr[x];
return tmp;
}
I want to pass a command as a command line argument from one batch file to another
e.g.
first.bat
call test.bat "echo hello world" "echo welcome "
test.bat
set initialcommand=%1
set maincommand=%2
%maincommand%
%initialcommand%
Hi
I'm trying to get an SQL query to work within a JSP file. The JSP file is pulled by a VXML file here is my JSP file code:
<?xml version="1.0"?>
<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<% boolean success = true; // Always optimistic
String info = "";
String schoolname = request.getParameter("schoolname");
String informationtype = request.getParameter("informationtype");
try {
Class.forName("org.postgresql.Driver");
String connectString = "jdbc:postgresql://localhost:5435/N0176359";
String user = "****";
String password = "*****";
Connection conn = DriverManager.getConnection(connectString, user, password);
Statement st = conn.createStatement();
ResultSet rsvp = st.executeQuery("SELECT * FROM lincolnshire_school_information_new WHERE school_name=\'"+schoolname+"\'");
rsvp.next();
info = rsvp.getString(2);
}catch (ClassNotFoundException e) {
success = false; // something went wrong
}
%>
As you can see I'm trying to insert the value of the variable declared as "schooname" into the end of the SQL query. However when I come to run the jsp file it doesn't work and I get an error "ResultSet not positioned properly". When I put a standard query in (without trying to make it value of the variable it works fine)
Hope that makes sense, and thank you for any help!