file

What is C# for C " FILE *f;"?

I am a beginner in C# I wonder how to write in C# C's static void example(const char *filename) { FILE *f; outbuf_size = 10000; outbuf = malloc(outbuf_size); f = fopen(filename, "wb"); if (!f) { fprintf(stderr, "could not open %s\n", filename); exit(1); } fwrite(outbuf, 1, outbuf_size, f); fclose(f); } Plas...

What is default settings to reffer to file location in xcode project ?

What is default settings to reffer to file location in xcode project ? i have doubts between them relative to build project relative to project relative to enclosing group relative to source path Absolute path ...

PHP "The upload destination folder does not appear to be writable"

Hello fellows, When I try to upload a file on my localhost version of the website it gives me the following message: "The upload destination folder does not appear to be writable" The upload functionality is working perfectly on production server. I checked the permissions of the destination folder about million times still getting th...

Fastest method to read/write to SD card in Android?

There are a lot of different classes that can be used in various ways to read/write to files in Android. For example, you can make use of java.nio.ByteBuffer, FileOutputStream and BufferedOutputStream. Are there any general guidelines for what to use to read/write quickly to the SD card? For example, BufferedOutputStream seems as if it s...

How to find out mount/partition a directory or file is on? (Linux Server)

Is there a Linux command to easily find out which partition/mount a directory or file is on? (This is probably a RTFM question, and I feel guilty for asking it, but somehow, I can't find a good answer on google just yet..) ...

Saving a C struct with a char* string into a file

I'm trying to save a struct with a char* string into a file. struct d_object { int flags; int time; int offset; char *filename; }; The problem is that when doing that I will obviously only save the address of that pointer rather than the string. So what I've done is simply use a character array and but I'm forced to ...

Determine if a directory can be moved on NTFS

I have a directory that contains lots of files in a complex tree of sub-directories. If I try to move that directory into a another directory on the same partition, that operation could theoretically take constant time - a rename operation, basically. - as long as none of the files in the source directory are in use and there are no sec...

Python: read file line by line into array

How do I read every line of a file in Python and store each line as an element in an array? I want to read the file line by line and each line is appended to the end of the array. I could not find how to do this anywhere and I couldn't find how to create an array of strings in Python. ...

run python file

i dont have any experience in python programming but I get to run python file is there any one to help me pls here is the file content >>>>>>>>>>>>>> #!/usr/local/bin/python """ Based on: http://wxpsvg.googlecode.com/svn/trunk/svg/pathdata.py According to that project, this file is licensed under the LGPL """ try: from pyparsin...

Regex does not properly break down file path with a version number

Hi, I was using a regex pattern to break down the context path for a servlet. /{1,2}([^/{1,2}]+) This works great for simple paths like /User/folder1/folder2/folder3/. In more real world scenario however there seems to be a problem if one of the folder names contains a dotted version number, such as: /User/username/Library/Tomcat/...

Best way to check new-line-independent-identity of 2 files with python

I tried filecmp.cmp(file1,file2) but it doesn't work since files are identically except for new line characters. Is there an option for that in filecmp or some other convenience function/library or do I have to read both files line by line and compare those? ...

PHP file upload form cannot submit a POST variable?

I have a PHP file upload form with method="post" enctype="multipart/form-data" I am trying to do a <input type = "hidden" name = 'something' value = "something"/> along with the input for file upload, but I am not able to get the value of 'something' in the upload handling script like $_POST['something'] Is it not possible to use POST ...

release Assembly.LoadFrom file handle

Hi, I'm trying to get assembly version of an exe in C# with the following code Assembly asm = Assembly.LoadFrom(address); return asm.GetName().Version; it works perfect but if I try to delete the exe after I used this function, it says "Access Denied" since the exe is being used by another process! is there any Dispose call or somet...

codeigniter file upload - optional ?

I'm sure this is simple but I can't see how to make uploading a file with CI optional. If you leave the file input box empty, the error "You didn't choose an upload file" appears. The reason I want it to be optional is that my form edits a directory type listing, and I don't need to upload the image each time I edit the listing. Is th...

AIR - HowTo write a File

I want to generate a Class (.as) file and store it on the users desktop all from the AIR-App. Someone can describe the best practice method? Many thx and best regards... ...

How to remove a non-empty directory in C++?

In C++, how can I remove a directory with all its contained files? I know there is rmdir, but it will only remove non-empty directories, so how do I list and remove all contained files first? I know it shouldn't be hard using Boost Filesystem, but I kind of want to avoid building and depending on it just for this one little task ... ...

How do I redirect a URL to another URL in the hosts file, rather than redirecting an IP to a URL?

How do I redirect a URL to another URL in the hosts file, rather than redirecting an IP to a URL? ...

I want to parse multiple strings into variables from a .txt file in java. What's the easiest way to do it?

What's the best way to do it? Should I use the File class and scanner? I've never done it before and cant seem to find a solid guide for it online so I figured I would ask here. Thanks! ...

Reading a file to a string in C++

As somebody who is new to C++ and coming from a python background, I am trying to translate the code below to C++ f = open('transit_test.py') s = f.read() What is the shortest C++ idiom to do something like this? ...

how can create file in flash drive and don't allow delete permission for any user

how can create file in flash drive and don't allow delete permission for any user ...