file

How to sort files into folders by filetype on bash (with 'file' command)?

I have thousands of files without extensions after recovery (mostly pictures). I need to sort them into separate folders by filetype (folders must be created during sort process). I can determine filetype in linux using "file" command. Does somebody have bash script for it? For example: Initial dir contains files: 001, 002, 003, 004. A...

How to work with files in XPCOM

Hi all, I'm writing a Mozilla component to get all the links from a page an write them into a file using XPCOM and C++. I get all the links into an array like this: //doc is a pointer to nsIDOMDocument doc->GetElementsByTagName(NS_LITERAL_STRING("A"), getter_AddRefs(nodeList)); nodeList->GetLength(&nodeNumb); href = new nsEmbedString[...

Creating small Java file server, space limitation

So I am triyng to create small java server just for file storing with methods like Save(Key, Name, Data) ang Get(Key, Name). I want to limit my server file writing permissions for storing not more than some N gb of files totally (NOT for 1 key, but totally on server). My server is executable app, crossplatform (win, mac, lin) so I need o...

can directsound play raw binary sound file

hi, my question is can directsound play raw binary sound file witout a wav. header the thing is i took a binary file encoded in U-law ive decoded(PCM) it and now i need to play it. it lacks a header so can a directsound play the decoded file. ...

[VB.NET] Any way we can work with hex bytes and chars like in c++?

Well my question is simple and straightforward. Is there any way we can use hex values like in c++? I am going to write binary files, but for that i will have to define certain characters like this for example. \x00\x00\x11\x22\x33\x00\x00 I would first need to convert stuff like this to a byte array, and then write it to a binary te...

Download file from java application

Hi I need some help to download a file from my java application. The URL is "http://my.site.com/UICFEWebroot/QueryOneDateAllCur?lang=ita&rate=0&initDay=11&initMonth=10&initYear=2010&refCur=euro&R1=csv" I try using this code but the result is an empty file URL urlAgg = new URL(address); int lf = urlAgg.openCo...

Mysql won't start - ibdata1 corrupt? - operating system error number 13 - permissions issue

Server shutdown from power failure. Mysql will not start now. Disk is not full. Syslog is below Oct 11 15:03:31 joe mysqld_safe[24757]: started Oct 11 15:03:31 joe mysqld[24760]: 101011 15:03:31 InnoDB: Operating system error number 13 in a file operation. Oct 11 15:03:31 joe mysqld[24760]: InnoDB: The error means mysqld does not have ...

Is there a C# analogue of java.util.Properties class

Java has a Properties class that is nice for saving basic configuration information, e.g. a gui setting you would like to have persist from one session to the next. It saves and retrieves key value pairs as I recall and is quite simple to use. I have been looking for an analogue of this in C# but without success. Am I missing it? If th...

Gcc.exe: CreateProcess : No such File or directory - Error?

Hello, I am writing an Objective C program and i saved it as 'hello.m'. The problem is when i am trying to compile it usig MinGW it is giving an error gcc hello.m // i used for compiling and it is giving following error gcc.exe: CreateProcess : No such File or directory is there any way to fix ..so that i can move forward.. Thank Y...

Help reading every five lines from text file c++

As part of a larger assignment I have to create a method in a class that can read five lines of data then put that data into a dynamically created object. I am not sure how to go about getting the five lines of data separately into the object. The code should help to explain better but it does not work as desired. If someone can spot my ...

Django ajax file upload problem csrf

I'm trying to do a ajax file upload using django. I am trying to make this example work http://www.johnberns.com/2010/07/08/using-valums-jquery-ajax-upload-with-django-1-2/ But strangely I keep getting "None" for my csrf token and even more strange is that I am doing the POST call sending the file but all I get on the server is just th...

open a string in notepad at runtime in python

I have a string called 's' and I want to open it in notepad at runtime without saving it in/as a file. Is there any way to achieve this in python? ...

Keeping Pages in its own folder?

I'm wondering if it would be okay to keep all of my pages in one folder on a site. and leave only the index.html page in public_html? I know the URL will be like example.com/pages/about.html but theirs a way to change that right? ...

C# WPF - Printing all files in directory that has ".xml" format - "could not find part of the path c#"

Hi, First of all - i googled the problem, and nothing good related seemed to come up. Also it will probably seem to you that this question is a newbie one (and i must say i never had this problem when printing files in a directory. I am pretty new to WPF in C#. so.. I am having problems to Print all files in directory that has ".xml" f...

Remove blank lines that appear when writing to file (Java)

Hi guys. I have created a program which takes a text file full of 3 letter words and processes them, stores them in an array and then outputs to the build output in JCreator and then writes the same output to a file. Now, this program works fine, but when I print a lot of data - I get all of these blank lines inserted where there shoul...

server path / vs \

In some documentation, I have gotten the instructions to write SERVER_PATH\theme\ When I check _SERVER["DOCUMENT_ROOT"] from php info, it's /storage/content/75/113475/frilansbyran.se/public_html this renders ofcourse /storage/content/75/113475/frilansbyran.se/public_html\theme\ this looks really weird to me what's the difference anyw...

In C#, how do you check if a path is virtual or not?

Possible virtual paths: /folder1/folder2/image.jpg ~/folder1/folder2/image.jpg folder1/folder2/image.jpg Concrete path: C:\folder1\folder2\image.jpg D:\folder1\folder2\image.jpg C:/folder1/folder2/image.jpg C:/folder1\folder2/image.jpg How do you check whether a path is virtual or not in a way that's not prone to failure? The reaso...

PHP File Upload Problems

I wrote a Facebook app in PHP and need to be able to allow the user to upload an image to my server. I have used this code: <?php include_once('facebook.php'); $appapikey = 'API KEY HERE'; $appsecret = 'SECRET KEY HERE'; $facebook = new Facebook($appapikey, $appsecret); $fb_user = $facebook->require_login(); if((!empty($_FILES["upload...

Detecting RollOver files in Java

I am listening changes to a syslog file in Java. I use the accepted answer to process new entries to the file. However, I couldnt find an efficient solution for detecting rollover files. Syslog file might be rolledover daily or based on filesize. What are the best practises for handling such a case? ...

Automatically loading uploaded files from production Django server

What I'm looking for is a piece of Django middleware that catches a FileNotFound exception and attempts to rsync the file from the production webserver. This way you can develop your site with a copy of production data without having to continually rsync down all the uploaded files. I'm sure I've seen a solution to this problem on the i...