file

How to view filesystem in Eclipse PDT

I've been using Aptana standalone for a few months. I do a lot of quick fixes on various servers via Windows network share, and the Aptana File view is perfect for that. Aptana has a "File view" that allowed me to navigate my entire filesystem and quickly open files to make edits. I'm being pressured into using "proper" Eclipse PDT aga...

Get file type in .NET

How can i get type of file using c#. for example if a file name id "abc.png" and type of file will "PNG Image" same as third column "Type" in window explorer. ...

Writing to binary file in C++ and C#

Hello, I have 2 applications. One in C++ (windows) open a binary file and only reads from it, i use: fstream m_fsDataIN.open("C:\TTT", ios::in | ios::binary | ios::app); and the second application (is in C#) opens the file and writes to it. I use: byte[] b = ... //have a binary data System.IO.BinaryWriter bw = new System.IO.BinaryW...

Weird difference between new Date() and FileCreation date.

I'm running some test to prove a concept and i just wrote this code and found a weird situation: public class Test { public static void main(String[] args) { Date now = new Date(); File file = new File("/root/batch-experiments/test.txt"); try { file.createNewFile(); } catch (IOException e) { System.o...

MySQLdump results in lots of commented lines, no real content

I am trying to write a PHP program to automatically created backups of MySQL tables as sql files on the server: $backup = "$path/$tablename.sql"; $table = "mydbname.mytablename"; exec( sprintf( '/usr/bin/mysqldump --host=%s --user=%s --password=%s %s --quick --lock-tables --add-drop-table > %s', $host, $user, $passw...

directory structures C++

C:\Projects\Logs\RTC\MNH\Debug C:\Projects\Logs\FF Is there an expression/string that would say go back until you find "Logs" and open it? (assuming you were always below it) The same executable is run out of "Debug", "MNH" or "FF" at different times, the executable always should save it's log files into "Logs". What expression wou...

What's the benefit of deploying a war file instead of an exploded directory?

I'm configuring an installer for our product which, up until now, was distributed as a war file, usually on tomcat. Once tomcat has exploded the directory, the user has to open a properties file and set their database connection information. I'd like the installer to do this (we're using install4j) but there doesn't seem to be a built-in...

How to automatically upload a file once it has been "Browsed" without submitting the form

I have a website were users can create a profile and upload an image for their avatar. The way I have it set up now is a simple HTML form one with an upload box where you Browse to pick a file, and then press "upload" to submit the form. What technology/language would be the best to have the image automatically upload and display on th...

Cross server file transfer possibility- winserver2008 ?

Guys, I am new to this. Thus, really need your expert advice. I want to transfer file from C:/inetpub/vhosts/domain.com/subfolderA from Server 1 in location A into E:/inetpub/vhosts/domain.com of server 2 in location B automatically. Both are win server 2008. How possible izzit? Use vbscript call to copy all files/folders is defi...

.NET Library For Fixed Length Text Files

I'm looking for a .NET (much preferably open source in C#) library for dealing with fixed length field text files. It wouldn't be too much to write one, but existing, tested work is always nicer, to start with. I will be extracting data in fixed length fields from files produced by a PBX. Each PBX has its own file format, as well a se...

Where will WebLogic look for files by default?

Hi All, I have a web application deployed in WebLogic. In one of my java file, I tried to read PleaseNote.txt as following: File file = new File("PleaseNote.txt"); Now WebLogic is taking PleaseNote.txt from its domain directory.My question is: [1] Why it is domain directory? Why not the directory where my java file which has the abo...

html, file uploading trouble

Hello, I have a trouble with file-uploding. Here is my part of the form: <input type="file" name="image_file" /> <input type="submit" name="add_new" value="Upload" /> And in script i have a code: print_r($_FILES); After image choosing and sending form, I have an empty array $_FILES. Why? ...

Is there a line length limit for text files created from Perl?

While writing a Perl script, I got a requirement to write the user names with comma separation in only one line of the file. That's why I would like to know is there any restriction on the maximum size of the line in the .txt file. ...

How to verify if an arg is a valid file name in Shell?

I need to verify if the args are valid file names, is this the right way to do it? It seems like I made some mistake inline 2, but I don't know where. for i in ${@}; do if [ -f ${i}]; then echo ${i} else continue fi done ...

java language. it says my file doesn't exist but it does

private void traverse(String dir, int ctr) throws IOException { // get current file and name File myFile = new File(dir); System.out.println("dir path: " + myFile.getAbsolutePath()); // correct path System.out.println("exists? : " + myFile.exists()); // returns false String name = myFile.getName(); System.out.println(dir +...

All possible ways to read a file from a remote server

Hello, i want to provide most possible flexibility for my script and so i need all possible ways in php and javascript to read the content(not sourcecode) of a php file from a remote server. so far i found curl, fopen and include for php and none for javascript, but i dont even know if this is possible with javascript. Thanks for any hin...

How do I scan a remote file system efficiently?

I do have a time limit and would like to know what is the efficient way to scan file system remotely (talking about 50 millions of files in the extreme case)? The command dir takes ages (approx time 20 hours!!!). ...

Setting file permissions using Rake

I'd like to set the file permissions for a copied file using a rake task. Is this possible? ...

C# Get File Owner from Linux File

I have a problem that I am hoping someone can help with. I have a c# application that needs to get the File Owner information from a file that resides on a Linux server. The .Net System.IO GetFileInfo throws an exception and the WMI calls fail. I know there is the PInvoke method GetFileOwner however the example on pinvoke.net is not comp...

Upload file in ASP.NET without user interaction

I have very little experience in ASP.NET, so sorry for maybe easy question. I need to upload a file from a WinForms application to a server, where the file will be automatically processed and saved to a database, without any other user interaction on the server. I don't have any physical server, all will run on a shared webhosting with...