file

c# Add As Link not working (always copies to Project folder?)

c# VS2008 SP1 right Click on Project name, Add Existing Item, selecting Add As Link from the drop down menu, and selecting a .cs file outside of the project folder, causes the file to be copied locally within the project folder. This is surely not the correct behavior? ...

Case-sensitivity issues with mounted samba share

I'm trying to read a file on a samba mount point. I can list the file, and I can stat the file. But I can't open it without unless I have the correct file name case. Unfortunately, I can't programmatically determine the file name case (short of listing the directory, which is too slow). $ ls /mnt/windows_share/file001.txt /mnt/windows_...

Automatically create directories from long paths

I have a collection of files with fully qualified paths (root/test/thing1/thing2/file.txt). I want to foreach over this collection and drop the file into the location defined in the path, however, if certain directories don't exist, I want them to great created automatically. My program has a default "drop location", such as z:/. The ...

how to read a file from documents directory

i hav to read the file with name myname.plist from documents directory .....i want to store the content of the file to string.... ...

how to display multiple line file contents in javascript

I have a page where onclick on a button displays the text content from the file in the text area on the page javascript function function displayOutput() { <?php $logfile = "hello"; $fh = fopen($logfile, 'r'); $size = filesize($logfile); if($size == 0) { ...

How to create a file , inclluding folders for a given path ?

Hai friends, Am downloading a ZipFile from web. where it contain folders and files. Uncompressing them using zipInputstream and zipentry . zipentry.getName giving name of file as "htm/css/aaa.htm". so i am creating New File(zipentry.getName); But problem it throwing an exception File not found. i got that it is creating subfolders ht...

how to post form details including the url of a file uploaded to a csv file with php

Hi, Please could someone help with the following: Using PHP I want to be able to post the details entered into a form to a csv file. This is quite straight forward on its own, however one of the fields in the form needs to upload a file, so the csv file needs to contain a link to where the file is saved. Thanks ...

create subdomains only through a php file ?

wo, is there a way to create subdomains only through a php file ? like create a function call createsubdomain($username) or something? that would really be helpful in the sense that as soon as a user registers himself on a website, he gets to access hisname.thewebsite.com to access his full profile thanks for replues equatorlounge.wo...

Problems Writing to Files at the right place

Hello all, I am finding a line in a PHP file using PHP and writing to it by changing a variable at a particular line. Please see function below. This works fine when I test it on its own. However, when I run it within my main script it doesn't work properly. I find the following sort of thing on = "Version_3_18110"; in the PHP file whe...

Groovy - create file issue: The filename, directory name or volume label syntax is incorrect

I'm running a script made in Groovy from Soap UI and the script needs to generate lots of files. Those files have also in the name two numbers from a list (all the combinations in that list are different), and there are 1303 combinations available and the script generates just 1235 files. A part of the code is: filename = groovyUtils....

How to copy all the files of a particular type using Perl?

Right now, I am using something like copy catfile($PATH1, "instructions.txt"), catfile($ENV{'DIRWORK'}); individually for each of the .txt files that I want to copy. This code is portable as it does not use any OS specific commands. How can I copy all the text files from $PATH1 to DIRWORK, when I do not know the individual names of a...

How to retrieve file names and subdirectory names from a directory in C?

Ok I have something like this: struct dirent *dp; DIR *dir; char fullname[MAXPATHLEN]; char** tmp_paths = argv[1]; //Not the exact code but you get the idea. ... while ((dp = readdir(dir)) != NULL) { struct stat stat_buffer; sprintf(fullname, "%s/%s", *tmp_paths, dp->d_name); if (stat(fullname, &stat_buffer) != 0) ...

problem with nspropertylistserialisation

not getting the data to the array variable NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path=[documentsDirectory stringByAppendingPathComponent:@"Employees.plist"]; NSData *datas = [NSData dataWithContentsOfFile:path]; ...

How can I find files that are bigger/smaller than x bytes?

In terminal, how can I find files that are bigger or smaller than x bytes? I suppose I can do something like "find . -exec ls -l {} \;" then pipe the result to awk to filter by file size. But shouldn't there be an easier way than this? Thank you. ...

Abort linux polling

I am porting an audio mixer from directsound on Windows to alsa on Linux. I am polling on, let's say, 16 file descriptors using the system call "poll". Now i need to be able to abort the polling somehow. On Windows i am using the WaitForMultipleObjects using events and when i need to abort the waiting i just SetEvent on one of the events...

File handling in core java

I need to do some housekeeping.I accidentally setup my classpath same as my codebase and all classes are placed along with my code.I need to write a quick java program to select all files of the type .class and .class alone and delete it immediately.Has anyone done something related to this? ...

Codeignitor view url?

i cal upload images to folder if i use absolute url. but how to use absolute url? function do_upload() { $config['upload_path'] = 'upload/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '100'; $config['max_width'] = '1024'; $config['max_height'] = '768'; $this->load->library('upload', $config); if ( ! $...

[Android] Binding EditTextPreference to a given preference file (getSharedPreferences)

Hi, two activities here, A and B. A is main, B is PreferenceActivity with two EditTextPreference. I want to be able to access the preferences generated by B from activity A, and for that I need of course (I guess) getSharedPreferences on A. But in order to do that I need to supply the preference file for the activity that generated it. ...

How to save a file with C++ in Windows 7

I did a program in C++ but it does not allow to save on c:\SomeDirectory\afile.txt I'm using this: FILE* m_hFile = fopen("c:\\SomeDirectory\\afile.txt", "a+t"); fprintf((FILE *)m_hFile, "testing"); fclose(m_hFile); Why that? Is there a defined folder I can save in? ...

Is there a more concise way to write this in Perl?

This subroutine is passed an array of file handles to close, which it closes one by one using the foreach loop: sub closef { foreach(@_) { my $fh = shift; close $fh; } } Where all can this simple subroutine be modified to make it better? Should I use close shift instead of doing it in two lines? ...