Hi
I have a domain domain.com and subdomain sub.domain.com Those two domains have different ftp users (user1, user2) belonging to the same group (usergroup) on linux environment. Finally I have the same PHP application that uses sessions on both domains (one is live and other is testing environment).
When I go to domain.com without go...
In Perl, I need to read a .conf file that contains either a 0 or a 1. If the value is one, I need to execute whatever is in the if statement. Here is what I have now:
open(CONF, "/var/web/onhit.conf");
if(<CONF>) {
print "Hello World!";
}
close(CONF);
The contents of the if statement always evaluate, even if the .conf file contains...
What's the simplest way to associate my application with a file-extension that works for both Vista and previous versions of Windows ?
Does anyone have an example ?
...
We often replace non-desirable characters in a file with another "good" character.
The interface is:
procedure cleanfileASCII2(vfilename: string; vgood: integer; voutfilename: string);
To replace all non-desirables with a space we might call,
cleanfileASCII2(original.txt, 32 , cleaned.txt)
The problem is that this takes a rather lon...
In C file I/O, the O_DIRECT flag can be used to minimize cache effects for a file being open()ed. I understand that this is not a POSIX feature, has been present in the Linux kernel since version 2.4.10, and that Linus is opposed to the interface in general. Under NetBSD, it seems to work as advertised. Example call:
int fd = open(f...
I know there is ftplib for ftp, shutil for local files, what about NFS? I know urllib2 can get files via HTTP/HTTPS/FTP/FTPS, but it can't put files.
If there is a uniform library that automatically detects the protocol (FTP/NFS/LOCAL) with URI and deals with file transfer (get/put) transparently, it's even better, does it exist?
...
Hi-
I would like to write a function copy(File f1, File f2)
f1 is always a file.
f2 is either a file or a directory.
If f2 is a directory I would like to copy f1 to this directory (the file name should stay the same).
If f2 is a file I would like to copy the contents of f1 to the end of the file f2.
So for example if F2 has the conten...
I am working on porting over a database from a custom MSSQL CMS to MYSQL - Wordpress. I am using Python to read a txt file with \t delineated columns and one row per line.
I am trying to write a Python script that will read this file (fread) and [eventually] create a MYSSQL ready .sql file with insert statements.
A line in the file I'm...
Hi there.
I've worked with a few scripts to begin uploading files on my development machine. Problem is, despite the expected ease of this operation, Apache seems to time-out whenever I try to upload an image. Uploading is set to On and the tmp directory is set in php.ini.
I tried uploading the main gif from Google, an 8.36KB image. I...
I have 2 simple questions about python:
1.How to get number of lines of a file in python?
2.How to locate the position in a file object to the
last line easily?
...
For example in windows explorer?
...
I have a django form where I have a FileField which accepts user's resume. I am gonna convert the resume to a html document LATER. So I thought of pickling the original document right away and store in it a db colum and later unpickle it and convert it. Is that possible?
...
Hi! I simply wanna read in a logfile, do a search and replace, and then write out the changes to that same logfile.
What's the best practice way of doing this in Perl?
...
Hey there
I'm trying to create an application which scans a drive. The tricky part though, is that my drive contains a set of folders that have folders within folders and contain documents. I'm trying to scan the drive, take a "snapshot" of all documents & folders and dump into a .txt file.
The first time i run this app, the output wi...
I have a problem while loading my jar file at run time.
My hotel.jar is loaded and a method of it (makeReservation) is invoked using the following code:
File file = new File("c:/ComponentFiles/hotel.jar");
URL jarfile = new URL("jar", "", "file:" + file.getAbsolutePath() + "!/");
URLClassLoader cl = URLClassLoader.newInstance(new URL[]{...
Hi, I am trying to do pretty much the same, as is for example on sourceforge. After a user creates some data, i generate a file and i want it to be offered to him after a page loads. However, i know almost nothing about javascript and simple copy paste of
< script type="text/javascript">
var download_url = "http://downloads.sourceforge....
Is there any way to figure out the length of a .dat file (in terms of rows) without loading the file into the workspace?
...
I have to test some "random numbers" generatied by a program in matlab, with diehard. it accept only 32 bit binary file, while if i save my data in matlab, they are saved in binary file with double precision (so 2*64=128 bit binary file). how can i take a 32 bit binary file in matlab, working on a 64 bit system?
...
like /usr/local?
I tried file:///usr/local but failed
[root@www2 robot]# cd file:///usr/local
-bash: cd: file:///usr/local: No such file or directory
...
update - if I remove the runat="server" this does not happen...then how do I get the value of the dialog back to the code behind
Scenario goes like this. I have this code on my page
<input type="file" id="ID" runat="server" /> <asp:Button ID="btn" runat="server" Text="click me you chump" />
when I browse to a large file (200mb) and t...