In my program I need to check that several paths to files are inside system temporary files folder (for example C:\Users\Roman\AppData\Local\Temp).
I haven't found any method in System.IO.File, System.IO.Directory and System.IO.Path classes to do so. So I created my own:
public static bool IsSafeToDeleteFileOrDirectory(string path)
{
...
I'm developing an application ased on zend framework,
and the problem that it is giving to me is this, when i echo zend file element like this:
<div id="add_video" title="Add Video">
<?php echo $this->form->video_title;?>
<?php echo $this->form->video_thumb;?>
<?php echo $this->form->video_video;?>
</div>
And i have this i...
Why should I use a human readable file format in preference to a binary one? Is there ever a situation when this isn't the case?
EDIT:
I did have this as an explanation when initially posting the question, but it's not so relevant now:
When answering this question I wanted to refer the asker to a standard SO answer on why using a human...
I've been working on an app running in a browser and I would like to try to convert it to an AIR one.
In my web app, after loading the document, I am loading a text file in a string with jquery.
var info;
$.get('media/info.txt',function(data) {
info=data;
alert("the info is "+info.length+" bytes long");
});
In my AIR app, after...
Looking for information regarding the advantages and disadvantages of both fcntl and lockf for file locking. For example which is better to use for portability? I am currently coding a linux daemon and wondering which is better suited to use for enforcing mutual exclusion.
...
I'm a beginner in python. I have a huge text file (hundreds of GB) and I want to convert the file into csv file. In my text file, I know the row delimiter is a string "<><><><><><><>". If a line contains that string, I want to replace it with ". Is there a way to do it without having to read the old file and rewriting a new file.
Normal...
Hi, I am trying to upload files to my server using php to save them into a binary form into my mysql database but I cant get it to work, here is the script I’m using, I believe it has something to do with "$_FILES" because when I take this out "&& $_FILES['userfile']['size'] > 0" the script starts to run but then the variables underneat...
I want to create a Java File object in memory (without creating a physical file) and populate its content with a byte array.
Can this be done?
The idea is to pass it to a Spring InputStreamSource. I'm trying the method below, but it returns saying "the byte array does not contain a file name.".
MimeMessage message = mailSender.create...
Hi,
Last time I asked a similar question but that was about svn related versioning info. Now I am wondering how to query windows "File version" attribute about eg. a dll. I payed attention to wmi and win32file modules as well without success. Thanks U in advance.
D.
...
1st of all: I'm not programmer, neither Linux guru, just have to work with Linux, Oracle, shell scripts.
My current task is to monitor a table in Oracle (tool: sqlplus), and if it contains a certain row, then watch a linux directory for a growing tmp file, and log its attributes (e.g. ls -l), in every 5 second.
The most important part...
G'day all,
I have an application which needs to display an ASCII file of 15 lines in a Swing component that cannot be edited by the user.
Below is my code which reads the ASCII file byte by byte. My thanks to the helpful commenters who explained that a JTextArea.setEditable(false) would be appropriate in Swing.
However, my code mer...
When reading files off of a hard drive, mmap is generally regarded as a good way to quickly get data into memory. When working with optical drives, accesses take more time and you have a higher latency to worry about. What approach/abstraction do you use to hide/eliminate as much latency and/or overall load time of the optical drive as p...
What is the correct way to declare and use a FILE * pointer in C/C++? Should it be declared global or local? Can somebody show a good example?
...
Context: I was going to build app using mod_rewrite (front page loading child pages), but got stuck on loading session_enabled pages from the front controller page.
Problem: The problem is that I use session_start() call twise, PHP page stops responding. Which is strange, the session_start function is harmless and they are called on di...
Is it possible to prevent a user from typing in a file input text box in IE? The reason I ask is that if a user enters text that does not look like a file system path (eg. doesn't start with something like c:...) then when the user clicks the submit button nothing will happen.
I would either like to not allow the user to type in the bo...
If i submit my ajax form from jQuery, and do
print_r($_FILES);
i get a list of files uploaded,
but if i do something like this
$add_form->sound_file->isUploaded();
or
$params = $this->_getAllParams();
print_r($params);
i don't get my file in zend parametars, and i don't get it uploaded!?
Mayb the problem is with he context b...
Is it possible to make an executable look like a read-only file on Linux, such that opening the "file" for reading actually executes the file and makes its stdout available for reading as if it were data in the "file"? It should be openable by any program that knows how to open a file for reading, for example 'cat'.
...
Hi guys, I'm writing a program that writes output to a file. If this file doesn't exist, I want to create it.
Currently, I'm using the following flags when calling open:
O_WRONLY | O_CREATE
However, when this creates the file, it doesn't give me any permissions to write to it...
How can I use open so that it creates a file if it doesn...
Update: My current question is how can I get my code to read to the EOF starting from the beginning with each new search phrase.
This is an assignment I am doing and currently stuck on. Mind you this is a beginner's programming class using Python.
jargon = open("jargonFile.txt","r")
searchPhrase = raw_input("Enter the search phrase: ")...
This is with reference to the question I asked earlier -
What is the correct way to declare and use a FILE * pointer in C/C++?
MyFile.h
char sMsg[712] = "";
#define STD_MSG(string) \
fprintf (stderr, string)
#define ERR_MSG(fp, string) \
fprintf (fp, "%s\n", string);\
fflush (fp)
MyFile.C
#include "PdmTestClnt.h"
//---...