file

How do I scp the (huge) output of a command directly to a remote machine?

Note that I can't first store the file locally -- it's too big. This (obnoxious) page (scroll all the way to the bottom) seems to give an answer but I'm having trouble disentangling the part that's specific to tape drives: http://webcache.googleusercontent.com/search?q=cache:lhmh960w2KQJ:www.experts-exchange.com/OS/Unix/SCO_Unix/Q_2424...

Does this C# routine to delete all files that are NOT in an array look alright?

I have a DB that contains a list of paths to files. I want to build a routine to cleanup the folders, removing files in the directories if there is not a db record for it (for temp ajax file uploads, in cases where the user doesn't complete the form, etc...). I'm thinking something like this: var dbFiles = db.allPaths(); var allFiles =...

c++ qt read xml file

if i got an xml file like this: <?xml version="1.0" encoding="utf-8"?> <name> <id>1</id> </name> how can i read everything that i got string id = ... (1 in this case); ...

Java how to display the JTree File model if the application is jar file format.

I had an application with JTree will display the file in certain directory. After i export this application to jar file. The JTree can not read the file from the directory. Any idea? ...

JTree File model doesn't work after export to jar file

I had a jTree file model root set to "file/" all works fine, when the application export to jar file, it can't works. Any idea why does it happen? ...

file upload problem with browser

hi var file_upload=document.getElementById('picture-upload').value; The code returns diffrent values in two browsers. in firefox,ie returns 'filename.ext' example: test.jpg but in opera returns 'fullpath\filename.ext example:C:\fake_path\test.jpg Is any one knows the problem ...

Differentiate between a parameter that can take either file contents or file path in PHP

Hey all, I'm implementing a function called attach. I'm looking for a way to take a param that is either a file path or a file's contents. Here's what I have: /** * @param name - name of the file * @param file - either a file or a file path */ function attach($name, $file) { $attachment = array(); $attachment['name'] = $n...

Java check whether file is binary

Hello all. I wrote the following method to see whether particular file contains ASCII text characters only or control characters in addition to that. Could you glance at this code, suggest improvements and point out oversights? The logic is as follows: "If first 500 bytes of a file contain 5 or more Control characters - report it as bi...

Deleted files not being removed from HDD in Ruby

I'm experiencing a weird situation with deleting files in Ruby, the code seems to report correctly, but the physical file isn't removed from my hard drive. I can do rm path/to/file on the command line - that works. I can even open up the Rails console and File.safe_unlink the file and that also works, it's just within my Rails app it fai...

How to attach a file to an email using SQL stored procedure?

Can't seem to find much information about how to attach a file that's been stored as a BLOB as part of an email. I know you can attach files from the file system (C:\temp...) to email that are being setup in DBMAIL or custom stored procedures. However, I haven't seen any references to attaching something such as a PDF that's been store...

Importing csv, tab delimited and excel files into c#

I'm developing an Excel import routine which is using OLEDB to read the file. Can I just reuse my code to do the same thing for csv and tab delimited files by just changing the connection string, and what would the strings be? ...

jquery file tree - folder open by default?

Hi all, I was wondering if anyone could help me out with jQuery file tree (jQuery File Tree) I was wondering if/how it would be possible to set some kind of variable that will tell the file tree to have a certain folder open on load. (eg. folder /images/fruit/ to be open by default) Here's the code to call the filetree: $('#container_...

How to check whether a folder or a file is hidden=

I want to find out whether a file or a directory is hide. At first I made use of CFile::GetStatus(), however I found this api sometimes will return FALSE. I don't know why, So I wrote the following code, However I found it is not stable. What is wrong with my code? BOOL IsHide(const CString& strPath, BOOL& bIsHide) { if (strPat...

InputB vs. Get; code pages; slow reading on unix server

Hi, We have been using the usual code to read in a complete file into a string to then parse in VB6. The files are ANSI text but encoded using whatever code page the user was in at the time (we have Chinese and English users for example). This is the code Open FileName For Binary As nFileUnit sContents = StrConv(InputB(LOF(nFileUnit), ...

Why is the concatenation of a set of files greater than the sum of the parts?

In an obscure way, it is a programming question. I concatenated several sets of text files in the range of 1MB and found that in each case the concatenated file size was much larger than the sum of the individual files by a large extent (2x-4x times more, even greater for Windows7). Why is this? ...

Windows 7 File Date Question

apologies for not asking a strictly programming question, but this will move on to programming once my confusion is cleared. i am about to write a program that can modify file date stamps like created, modified, last accessed date. as i am investigating on Windows 7, it seems to provide more date fields. exactly how many file attrib...

Django file upload/download in a social community

I have a social community built in Django, and i want to add a upload/download/read(documents) feature for users, so that many users can do these operations in the same time. What do you recommend me? The standard Django upload/download document feature is ok for that purpose? Thanks! ...

QXmlStreamWriter add at end of file

i got an QXmlStreamWriter and add some xml to it. when i do it first time its ok, but when i want to add text at end of file it dont work. the only thing i got is first few lines i wrote good and formatted xml and the second thing i wrote is everything on 1 line. :S how to fix this? ...

How to search for .xml files within project files in Silverlight

I want to search for files with .xml extension within my silverlight project, for example (ApplicationRoot)/Resources/102.xml I know how to do this using System.IO.Directory: // create a collection to hold the file enumeration List<string> directoriesInFolder = new List<string>(); // using the file api to enume...

IIS log files directory

Hi guys How to know IIS logfile directory using asp script file? ...