How can I get file's modification date in DDMMYY format in Perl?
What's the best way to do it? EDIT: Originally the question was "How to do it without the DateTime module". I removed this restriction in order to make the question more general. ...
What's the best way to do it? EDIT: Originally the question was "How to do it without the DateTime module". I removed this restriction in order to make the question more general. ...
currently we are developing an app in which we use database table to store platform settings, like maximum file size, maximum users number, support email, etc. it means that each time we add a platform setting we have to add a column to this table. in my previous projects i am used to store such information in file. what is better/fa...
Okay, I'm a beginner when it comes to C, so bear with me. Here's the problem: I have a text file with up to 100 IP addresses, 1 per line. I need to read each address, as a string, into an array called "list". First, I'm assuming that "list" will need to be a two-dimensional char array. Each IP address is 11 characters in length, 12 if y...
Is it possible to copy a new file created by third party application inside a directory automatically on windows? It goes like: Third party process 'P' creates a new temporary file 'F' inside a directory 'D'. Whenever this file F is created by the process P, I want to copy this file F into another directory D2. Additional problem is th...
Hello, I'm working with a GPS module that is transferring data to my mac over a serial RS232-to-USB interface. I've written a objC program that takes the raw data and converts it into meaningful information. Using a program called goSerial, I'm able to log all incoming data into a text file. I have been able to make my program read the...
Having problems with a Ruby script that uses File.Open Here is the code that I am speaking of... f = File.open(Socket.gethostname().gsub!(/[[:space:].]/,"")+".log","a") The issue is the + inside of .open, it is returning a error message saying its a undefined method. Anyone able to help? Edit: Here is some code from the class which ...
When I create a zip file using SharpZipLib I end up with .tmp files litering my hard drive. It occurs when I add files to an archive. I'm not too concerned that it's happening, but I'd like to be able to get the file name so that I can remove the files once the archive is completed. How do I get the name of the .tmp file? ...
Hi ppl Got to use lseek function in this program below... Program is simply copying file (that already exist). I wanned to copy the existing file with the chars from the end of file for example: Sorce_File.txt contains:"1 2 3" after copy Target_File.txt contains:"3 2 1" I'm pretty sure it's simple problem but couldn't find out since 2...
Hi. I am creating a simple Unix server written in C++ that simply waits for incoming connections, and then when a connection is established, it sends the requested data back to the client's browser to be displayed. I have everything working except for the sending of the data to the client. This is how it should work: I start server and...
In holy wars about whether garbage collection is a good thing, people often point out that it doesn't handle things like freeing file handles. Putting this logic in a finalizer is considered a bad thing because the resource then gets freed non-deterministically. However, it seems like an easy solution would be for the OS to just make s...
Is there an easy way to determine what a file is by its extension in C#? For example if I pass a file extension of ".txt" then it will return "Text Document" or if I pass it ".pdf" it will return "Adobe Acrobat Reader". I see this behavior built into Windows Explorer, under the "Type" column. Is there a way to mimic this in C#? ...
Hello. A couple day ago i noticed that traffic had increased dramatically. Upon checking i noticed in my stats program that the extra traffic was from a direct source. ...
I need to read file and split string into hash table in C#. For example; 1231231 Hi this is the first entry / hi this is the second entry Currently, I'm reading the lines in the files line by line using a StreamReader, and then I splitting every line to 3 different strings. For example, "1231231" to one string, then up to "/" sign to...
Is it possible to open files from a given directory in C/C++ using wildcard characters? In the sense, If I want to open files that end with "to(node_id)" from a given current directory in my program. Example : I need to open files whose filenames end with "to4". Desired Output : It must open all the files in the current directory with ...
Hello All, Is there a way to get user-defined php functions, variables, constants from a php file? Following functions are not the best way to do so because they get all decalred functions/vars/constants (with hundreds of php's built-in constants and internal php functions): get_defined_vars get_defined_functions get_defined_consta...
I am using poi-3.5-beta5 to read excel file. I am trying to open excel file through XSSFWorkbook workBook = new XSSFWorkbook (xlsPath); i am getting following error (although i am not using log4j) Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger at org.apache.poi.openxml4j.opc.Package.(Package.java:...
The cplusplus.com example for reading text files shows that a line can be read using the getline function. However, I don't want to get an entire line; I want to get only a certain number of characters. How can this be done in a way that preserves character encoding? I need a function that does something like this: ifstream fileStream;...
Hello, I am trying to write some code that will open a file, read its content line by line and store each of these lines into an array. First I open the file and count the number of lines, each of the lines is of a fixed length so I simply do this : char buf2[LINE_LENGTH]; int in2 = open("toSend2", O_RDONLY); int number_o...
def checkCache(cachedText): for line in open("cache"): if cachedText + ":" in line: print line open("cache").close() else: requestDefinition(cachedText) This code searches each line of a file (cache) for a specific string (cachedText + ":"). If it does not find the specific stri...
Which method of the File class can I use to return the absolute path of a text file whose name is already mentioned in the application. In other words, the name of the file or its relative path is not to be typed in by the user. ...