1
голосов
1ответов
103 просмотров

How to share files in a depot

We are using Perforce. In the depot are some projects that have their own main/branches/releases sub folders. There are also some resource files (png, mp3 and so on) that are needed (shared) for some of the different projects. Those don't have the main/branches/structure. Currently they are store...

0
голосов
5ответов
1107 просмотров

How to export 20 000 contacts from MySQL database via PHP for import into an desktop address book?

I need to write a script to export contact data for printing on stickers for mailing. There could be up to 20 000 records in the database table. The main problem is that the number of records could be so high and the site is hosted on a shared server and exporting the whole 20k records would, pr...

35
голосов
6ответов
31858 просмотров

Optimal lock file method

Windows has an option to open a file with exclusive access rights. Unix doesn't. In order to ensure exclusive access to some file or device, it is common practice in Unix to use a lock file usually stored in the /var/lock directory. The C instruction open( "/var/lock/myLock.lock", O_RDWR | O_...

9
голосов
4ответов
24649 просмотров

PHP: Force file download and IE, yet again

Folks, I know there have been lots of threads about forcing the download dialog to pop up, but none of the solutions worked for me yet. My app sends mail to the user's email account, notifying them that "another user sent them a message". Those messages might have links to Excel files. When the...

1
голосов
1ответов
160 просмотров

Network File Streaming Performance Vista

How can I achieve the best file streaming performance in Vista? My goal is to read a large file (several hundred MB) over the network directly into memory. I've allocated a memory block the same size as the file. This is also my destination buffer. I've tried ReadFile, _read, fread, ifstream::re...

1
голосов
2ответов
233 просмотров

File written by old C code, moved to C#

I'm working on converting an old C program (currently run on UNIX) into our C# system. The program builds some data into several structs and then writes a file using a series of fwrites like this: fwrite ( &loc, sizeof ( struct loc_items ), 1, hdata.fp ); With loc being the data, struct...

0
голосов
2ответов
1735 просмотров

using linq to select last written file

I wish to get the lastest written files from a directory and their extentions. An example of what file that could exist in the directory (with their creation dates): 2009-10-20T07:00:00.000 filename1.mp4 2009-10-20T07:00:01.000 filename1_0.mp4 2009-10-20T07:00:02.000 filename1_1.mp4 2009-10-20T...

4
голосов
5ответов
6132 просмотров

How do I explain my colleagues that filenames should not contain uppercase characters or special characters?

For what I know, it's best practice to name files like this: file_name.txt - or if you want to file-name.txt. Now some people seem to like to name their files fileName.txt or FILENAME.TXT or "File Name.txt" - how do explain them that it's not a good idea? Why exactly is the aforementioned file n...

1
голосов
2ответов
8772 просмотров

C++ writing string to file = extra bytes

I am using c++ to look through 256 counts and write the ASCII representative to a file. If i use the method of generating a 256 character string then write that string to the file, the file weighs 258bytes. string fileString = ""; //using the counter to attach the ASCII count to the string. fo...

0
голосов
2ответов
884 просмотров

accessing local file from php

I'm trying to gain access to a file on a client computer so that i can then later attach it to an outgoing email (resume.pdf) Ive found a few clips of code but I'm having trouble getting it to work for me. the code below seems to demonstrate all the things ill need to gather about my file but ...

2
голосов
5ответов
6355 просмотров

Hook into the Windows File Copy API from C#

Is there a way to hook into the Windows File Copy API from C#? I'm aware this would require unmanaged code, but a code sample or starter would be helpful. I've already seen the C++ code, but it's all greek. UPDATE: I apologize, I should have been more clear about my intentions. I wish to actu...

8
голосов
2ответов
6016 просмотров

Converting audio and video to NSData

I would like to confirm what the recommended ways are to convert audio and video files into NSData objects. Is + dataWithContentsOfFile: the best way to do this?

0
голосов
4ответов
2376 просмотров

Developing an Application for File Compression

How can I compress a file in c/c++? Since I want to devlop an application like WinZip / WinRAR. A simpler one.

15
голосов
4ответов
11008 просмотров

Why is fwrite writing more than I tell it to?

FILE *out=fopen64("text.txt","w+"); unsigned int write; char *outbuf=new char[write]; //fill outbuf printf("%i\n",ftello64(out)); fwrite(outbuf,sizeof(char),write,out); printf("%i\n",write); printf("%i\n",ftello64(out)); output: 0 25755 25868 what is going on? write is set to 25755, and I te...

1
голосов
2ответов
2836 просмотров

C#: Archiving a File into Parts of 100MB

In my application, the user selects a big file (>100 mb) on their drive. I wish for the program to then take the file that was selected and chop it up into archived parts that are 100 mb or less. How can this be done? What libraries and file format should I use? Could you give me some sample c...

4
голосов
2ответов
1663 просмотров

Combining Audio Files as One Properly on iPhone with NSData

I am using AVAudioRecorder to save an audio file every 15 seconds by stopping the recording appending that data to the previously recorder file using a NSMutableData object and using the appendData method. I then record again in the same method so the recording is "continuous". The problem is ...

57
голосов
4ответов
47571 просмотров

Difference between the access modes of the `File` object (ie. w+, r+)

When using files in Ruby, what is the difference between the r+ and w+ modes? What about the a+ mode?

0
голосов
1ответов
559 просмотров

How to best organize files

Often, when doing a process or storing files I typically try to work with a workflow, or system. For instance, when I download a file, I sort it within a folder Programming/Downloads/Templates/ or Libraries, etc., and when I start a project I create a new folder for it within a workspace folder....

0
голосов
2ответов
958 просмотров

Key compare using dictionary

I have a file with the following structure: system.action.webMessage=An error has happened during web access. system.action.okMessage=Everything is ok. core.alert.inform=Error number 5512. I need a script to compare the keys in 2 files with this structure. I was working in a script to convert t...

3
голосов
2ответов
3097 просмотров

file name with special characters like "é" NOT FOUND

I have a folder on my website just for random files. I used php opendir to list all the files so i can style the page a bit. But the files that I uploaded with special characters in them don't work. when i click on them it says the files are not found. but when i check the directory, the files ar...

6
голосов
2ответов
2341 просмотров

Why does bash sometime not flush output of a python program to a file

I have a crontab job calling a python script and outputting to a file: python run.py &> current_date.log now sometimes when I do tail -f current_date.log I see the file filling up with the output, but other times the log file exists, but stays empty for a long time. I am sure that t...

0
голосов
4ответов
5130 просмотров

attach file to email using php

I have an input on my form to allow a user to browse to a file location. The idea being that they can attach a resume to to the application they are getting ready to submit. <label class="description" for="element_5">Upload a File </label> <div> <input i...

2
голосов
3ответов
2142 просмотров

Variables magic and read from file

Assume, i got the following file (input.txt): name = "Peter" age = 26 family_status = married Mentioned lines can be stored in a random order, lie: family_status = married name = "Peter" age = 26 In my program I also have variables family_status, age and name. How do I in a single cycle rea...

4
голосов
4ответов
2813 просмотров

Check for files (robots.txt, favicon.ico) to a website php

I would like to check to a remote website if it contains some files. Eg. robots.txt, or favicon.ico. Of course the files should be accessible (read mode). So if the website is: http://www.example.com/ I would like to check if http://www.example.com/robots.txt. I tried fetching the URL like http...

0
голосов
1ответов
3012 просмотров

How to map file path from different folder location easily?

how to map the path to the file easily? public_html/api/function.php <?php function writetologfile($content) { $filename = 'logfile/testing_randomstring.txt'; if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } fclose($h...

29
голосов
7ответов
37360 просмотров

How to delete empty subfolders with PowerShell?

I have a share that is a "junk drawer" for end-users. They are able to create folders and subfolders as they see fit. I need to implement a script to delete files created more than 31 days old. I have that started with Powershell. I need to follow up the file deletion script by deleting sub...

0
голосов
1ответов
121 просмотров

How to prevent access to a single file based on IP using .htaccess?

All the resources I've read explain how to prevent access to an entire directory based on IP but don't explain how to do this for a single file. This is what is used to protect a directory: <Limit GET POST PUT> order deny,allow deny from all allow from 123.456.78.910 </Limit> H...

7
голосов
3ответов
6576 просмотров

Delphi - get what files are opened by an application

How can I get the list of opened files by an application, using Delphi? For example what files are opened by winword.exe

5
голосов
3ответов
10928 просмотров

Efficient way of handling file pointers in Java? (Using BufferedReader with file pointer)

I have a log file which gets updated every second. I need to read the log file periodically, and once I do a read, I need to store the file pointer position at the end of the last line I read and in the next periodic read I should start from that point. Currently, I am using a random access fil...

3
голосов
1ответов
2218 просмотров

Java Web Start: How to write files to windows UNC Path?

I have an Java application for copying large amounts of data from users' workstations to a server. The java.io.File class is supposed to work with UNC paths very well and in fact it does but only when I run the app in standard execution model. When the application is launched via Web Start I get...