file

cannot access excel file after renaming

I have renamed some excel files on my web server and after renaming the users cannot download those files. What could be the problem. They are all excel files. ...

(C#) How to check if System.Net.WebClient.DownloadData is downloading a binary file?

I am trying to use WebClient to download a file from web using a Winform application. However, I really only wanted to download HTML file. Any other type I will want to ignore. I checked the WebResponse.contenttype, it always return me NULL. Anyone have any idea what could be the cause? ...

how to see the schema of a db2 table (file)

As in subject... is there a way of looking at an empty table schema without inserting any rows and issuing a SELECT? ...

splitting files for P2P application

I have to implement a middleware system for file sharing, and it has to split the files not unlike what happens on bittorrent, where it sends and receives separate pieces simultaneously from varios sources. How do i do that? Is it a library or i have to implement the file splitting myself? ...

Fstreams C++

Hello I want the ofstream to write at the end of a file without erasing its content inside. how can i do it? (i'm talking about txt files,and C++) Thanks. ...

Can't copy file with appropriate permissions using FileIOPermission

Hello, This snippet works well if I try to write in a user directory but as soon as I try to write in Program Files, it just executes silently and the file has not been copied (no exception). If I try to copy the file in C:\ or in C:\Windows I catch an UnauthorizedAccessException. Do you know another way to get the permissions to writ...

Can you add documents and spreadsheets to a Visual Studio Project?

In Eclipse, I often include all project-related material (including documents in PDF, Microsoft, and OpenDocument formats) in the project. Is this possible with Visual Studio, especially to the point where if I attempt to open the file from inside Visual Studio, it will open in the external application? ...

What is the return value of feof() on a closed file?

for a FILE* stream, if I read as much data as possible, feof(stream) returns me non-zero. Then, If I fclose stream, it feof(stream) will continue to returns me a non-zero value? Is it GUARANTEED? ...

Writing resultset to file with sorted output

I want to put "random" output from my result set (about 1.5 mil rows) in a file in a sorted manner. I know i can use sort by command in my query but that command is "expensive". Can you tell me is there any algorithm for writing result set rows in a file so the content would be sorted in the end and can i gain in performance with this? ...

How do I watch a file for changes using Python?

I have a log file being written by another process which I want to watch for changes. Each time a change occurrs I'd like to read the new data in to do some processing on it. What's the best way to do this? I was hoping there'd be some sort of hook from the PyWin32 library. I've found the win32file.FindNextChangeNotification function bu...

Flat File Repair Tool

Scenario: Attempting to import many (>100), large(>1M recs) flat-files (csv). Problem: Many records are missing field delimiters. Asking: Is there a parsing tool that will attempt to define and validate the file and allow you to make "in-line" corrections? ETA: I'm attempting to import this files to MS SQL Server using the DTS Import ...

Delete Folder Contents in Python

How can I delete the contents of a local folder in Python. The current project is for Windows but I would like to see *nix also. ...

How to copy file from linux to windows server using c

I have to create a C program which will run on Linux server. It will take information from Oracle database, create a local file and then copy that file to Windows server. I know how to create a local file on Linux server. But what is the way to copy it to windows server from C? ...

Eclipse reading stdin (System.in) from a file.

Is it possible for Eclipse to read stdin from a file? ...

How does one use FileStream to append to a file without an exclusive lock?

What I'm trying to do with FileStream in C#/.NET is to open two streams: one appending to a file and the other reading those writes asynchronously (for unit testing some network connection handling code). I can't figure out how to get the writer stream to open the file in non-exlusive locking mode and thus the code always throws an exce...

How to determine the file size from an attachment to a POP3 message

I'm writing a program to read from a POP3 mailbox and upload the email message into my ticketing system. I would like to then take the attachments and upload them as well. I've got all the information I need except the file size. Is there a way to determine the file size from the mail message? I am taking the attachment, decoding the...

How can I change a files extension using PHP?

How can I change a files extension using PHP? ...

How to check if a file exists in javascript?

I'm using the jquery library to load the content of an html file. Something like this: $("#Main").load("login.html") If the file (in this case 'login.html') does not exist, I would like to detect it so that I can redirect the user to an error page for example. Any ideas how I can detect if the file to load exists or not? ...

How do I set the byte order marker for Unicode files?

I know this is not a "real" programming question. But, it relates to programming so I am going to set it anyway. I have a program that I need to test that reads the Byte Order Marker of the file to see if it is utf-8 or utf-16. My problem is I cannot find a program/text editor that will allow me to set the byte order marker. Can anyb...

Best way to list files in Java, sorted by Date Modified?

I want to get a list of files in a directory, but I want to sort it such that the oldest files are first. My solution was to call File.listFiles and just resort the list based on File.lastModified, but I was wondering if there was a better way. Edit: My current solution, as suggested, is to use an anonymous Comparator: File[] files = ...