file

NSArray writeToFile fails

Hi I am trying to save an array, which has some dictionaries inside, to a plist file but it fails. I don't get any errors. I do exactly the same few lines above in the code just with another array and that works.. I can't figure out why it does not save the file. This is where I save the file: (see some debugger output below) // When ...

git mv and only change case of directory

While I found similar question I didn't find an answer to my problem When I try to rename the directory from FOO to foo via git mv FOO foo I get fatal: renaming 'FOO' failed: Invalid argument OK. So I try git mv FOO foo2 && git mv foo2 foo But when I try to commit via git commit . I get # On branch master # Untracked files: # (...

Download a file with DefaultHTTPClient and preemptive authentication

After I had a lot of problems with preemptive authentication , I got it finally working. Now the next problem. I want to get a file with it, but I don't know how. I thought the file data might be in the variable response, but it isn't. Any ideas how this might work? I'm trying it since days without success :( - Basically I'm trying to do...

Swt file dialog too much files selected?

Hi there, the swt file dialog will give me an empty result array if I select too much files (approx. >2500files). The listing shows you how I use this dialog. If i select too many sound files, the syso will show 0. Debugging tells me, that the files array is empty in this case. Is there any way to get this work? FileDialog fileDialog =...

How to get PIDs that are using given file name in C#?

How to get PIDs of processes that are using a given file name and mutex name? (Not by custom kernel driver, but in C# in user mode.) UPDATE: Thanks to Daniel Renshaw I found a script that lists all handles with PIDs. (Using a not undocumented and unfrozen functions.) ...

remove extended attribute : fails

From a shell script, I'm trying to remove extended attribute setfattr -x security.selinux file.txt The file.txt has mode as 777 but im getting "permission denied error" How to fix this ...

File upload with Javascript without user intervention

I have a Firefox component for PDF signing that I invoke via Javascript. The problem is that this component outputs the signed PDF as a file on the user's filesystem - there is no way to get a byte[], stream or similar. I need to post this signed PDF file back to the server. Is it possible to do this in plain Javascript, without additio...

Changing FileNames using RegEx and Recursion

Hello I'm trying to rename files that my program lists as having "illegal characters" for a SharePoint file importation. The illegal characters I am referring to are: ~ # % & * {} / \ | : <> ? - "" What i'm trying to do is recurse through the drive, gather up a list of filenames and then through Regular Expressions, pick out file name...

Initialization discards qualifiers from pointer target type

I want to read a file, line by line and then assign to each line a variable. I have the following code: NSString *aFilePath= [[NSString alloc] initWithContentsOfFile:@"db.def"]; NSArray *lines = [aFilePath componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; char *server = [[lines objectAtIndex:0] UTF8Str...

How to read custom file properties in c#

I'm looking for a way to read document properties in C#. I've heard about dsofile.dll, but it seems like an old COM wrapper, and was wondering if there is something more modern for the .NET framework/C#. What I'm actually reading is not an office document file, but a Solidworks .SLDDRW file, that has Custom properties. You can view an...

Bash script question

Say I have a bash script as follows while read $f; do cat $f >> output.txt; echo "aaa" >> output.txt; done Yet the second echo statement isn't executed. At all. What am I doing wrong? I'm running this via tail -f /var/log/somelog | ./script.sh $f should not be empty. It's only supposed to output when tail notices a change in th...

Looping through a file in VB.NET

I am writing a VB.NET program and I'm trying to accomplish the following: Read and loop through a text file line by line Show the event of the loop on a textbox or label until a button is pressed The loop will then stop on any number that happened to be at the loop event and When a button is pressed again the loop will continue. ...

How to efficiently manage files on a filesystem in Java?

I am creating a few JAX-WS endpoints, for which I want to save the received and sent messages for later inspection. To do this, I am planning to save the messages (XML files) into filesystem, in some sensible hierarchy. There will be hundreds, even thousands of files per day. I also need to store metadata for each file. I am consider...

How get file path from std::ifstream in c++

Hi, I open a file using std::ifstream. I may open file using relative path (file.txt) or absolute path (C:\test\file.txt). As I am passing a string as the file name, I dont know whether it is relative or absolute path. Can anybody tell me how to get absolute path after file has been successfully open using std::ifstream ? e.g.: st...

How to create a new File in Qt

Hello friends, I am a Qt beginner and just got stuck with the problem. I am looking for a file SomePath/NewDirectoryA/NewFile.kml ( NewFile.kml will be the only file in NewDirectoryA, having this directory just to maintain semantics in the project ). If SomePath/NewDirectoryA/NewFile.kml exists then I will use it in my code and If it d...

how to code a batch file to automate django web server start

Hi, i really need a code sample to automate starting Django development webserver "python manage.py runserver" in a .bat file in windows . I have python26 and django 1.1.1 in installed Thanks i meant by automate is clicking on the .bat file and the Django development webserver start up and i have no batch file scripting knowledge wi...

Watin File Download Problem

When I clicked button with mouse, File Download Dialog opens directly. But when Watin Button Click methods click the vert same button on same ie window this message appears and wait my confirm To help protect your security, Internet Explorer blocked this site from downloading files to your computer. Click here for options. I ...

File modified date/time changes when uploaded via FTP

FTP/PHP question here. On one of my pages I load .txt files from a directory. Pretty simple. I also display the modified date of the text file using this: date('m/d/Y', filemtime($file)); This works fine on my WAMP server but when I upload the files via FTP, the modified date is changed to when they were uploaded. I'm currently hostin...

Writing to a file in Python inserts null bytes

I'm writing a todo list program. It keeps a file with a thing to do per line, and lets the user add or delete items. The problem is that for some reason, I end up with a lot of zero bytes at the start of the file, even though the item is correctly deleted. I'll show you a couple of screenshots to make sure I'm making myself clear. This ...

Python: slow read & write for millions of small files

Conclusion: It seems that HDF5 is the way to go for my purposes. Basically "HDF5 is a data model, library, and file format for storing and managing data." and is designed to handle incredible amounts of data. It has a Python module called python-tables. (The link is in the answer below) HDF5 does the job done 1000% better in sa...