Hi
Task: Cut or erase a file after first walk-through.
i have an install file called "index.php" which creates another php file.
<?
/* here some code*/
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "<?php \n
echo 'hallo, *very very long text*'; \n
?>";
fwrite($fh, $stringData);
/*herecut"/
/*here some code */
...
I need to read a file structured like this:
01000
00030
00500
03000
00020
And put it in an array like this:
int[,] iMap = new int[iMapHeight, iMapWidth] {
{0, 1, 0, 0, 0},
{0, 0, 0, 3, 0},
{0, 0, 5, 0, 0},
{0, 3, 0, 0, 0},
{0, 0, 0, 2, 0},
};
Hopefully you see what I'm trying to do here. I was confused how to do this so I asked her...
Hello,
What would be the best way to name a file associated to a NSManagedObject. The NSManagedObject will hold the URL to this file.
But I need to create a unique filename for my file. Is there some kind of autoincrement id that I could use? Should I use mktemp (but it's not a temporary file) or try to convert the NSManagedObjectId to...
When I type in the foll. code, I get the output as 1073741823.
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector <int> v;
cout<<v.max_size();
return 0;
}
However when I try to resize the vector to 1,000,000,000, by v.resize(1000000000); the program stops executing. How can I enable the program to all...
Moved the question here. Suppose, I want to store 1,000,000,000 integers and cannot use my memory. I would use a file(which can easily handle so much data ).
How can I let it read and write and the same time.
Using fstream file("file.txt', ios::out | ios::in ); doesn't create a file, in the first place. But supposing the file exists, I a...
I'm writing a small ruby daemon that I am hoping will do the following:
Check if a specific directory has files (in this case, .yml files)
If so, take the first file (numerically sorted preferrably), and parse into a hash
Do a 'yield', with this hash as the argument
What I have right now is like:
loop do
get_next_in_queue { |s| ...
Hi there!
Sorry the basic doubt but is there any recommended way to open a file using symfony? I'm trying to open a MarkDown source file.
Thanks for the help,
Best regards!
...
Hello there,
I am using C and my knowledge is very basic.
I want to scan a file and get the contents after the first or second line only ...
I tried :
fscanf(pointer,"\n",&(*struct).test[i][j]);
But this syntax simply starts from the first line =\
How is this possible ?
Thanks.
...
Hello there,
I had this code working yesterday, but it seems like I edited it a bit and lost the working version. I cant get this to work anymore.
I basically want to scan a matrix from a .txt file. But each time it scans the first row, the second one is skipped, and it reads the third instead :(
Here is my code :
for(i=0;i<=test->ro...
Hello
I have this in my .htaccess file, in the site root:
Options -Indexes
<directory ../.*>
Deny from all
</directory>
<Files .htaccess>
order allow,deny
deny from all
</Files>
<Files index.php>
Order allow,deny
allow from all
</Files>
What I'm trying to achieve is to block folder and file access to anything that isn't called in...
hello, i have an exsting file in my HDD and i want rename this file.
...
Hey SO,
I just started programming with objects recently and am trying to learn good habits early on.
The way I plan to structure my application is to have two files:
1: Program.cs - This file will contain the main logic for the application
2: Class.cs - This file will contain all of the class definitions
Pretty simple. What I'm w...
It appears that IE8 is not rendering properly a local file:
Consider this simple webpage: http://sayang.free.fr/ie8render.html (html code below) extracted from a w3c tutorial on opacity.
Save it locally and display it again: the local file has no opacity!
That's very annoying, especially when one wants to design complex pages on proto...
I need to get list of files on some drive with paths that matches specific pattern, for example FA\d\d\d\d.xml where \d is digit (0,1,2..9). So files can have names like FA5423.xml.
What is the most efficient name to do this?
...
Hey guys,
The other answered questions were a bit complicated for me, as I'm extremely new to using Perl.
I'm curious how Perl reads in the files, how to tell it to advance to the next line in the text file, and how to make it read all lines in the .txt file until, for example, it reaches item "banana".
Any and all help would be appre...
Is there a way to get a sorted list of file names of a folder in VBA? Up to now, I arrived at
Dim fso As Object
Dim objFolder As Object
Dim objFileList As Object
Dim vFile As Variant
Dim sFolder As String
sFolder = "C:\Docs"
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFolder = fso.GetFolder(sFolder)
Set objFileList = o...
Hey, I'd like to write to a text file to record a set of scores. However, everytime I write to it it overwrites what was originally in the file. Please can someone tell me how to not let it overwrite what is there or how to make it start writing in an empty space. Thank you in advance.
...
Hello!
I'm looking for a tool or component that generates flat files given a SQL Server's query result (from a stored procedure or a SELECT * over a table or view). This will be a batch process which runs every day, and every day a new file is created.
I could use SQL Server Integration Services (DTS), but I have a mandatory requiremen...
I'd like to create a page, which uses a local file in JavaScript. I don't need to upload it to the server really and I definitely don't want the page to reload completely.
What are the available options to solve it?
The best I could come up with so far, is to (not perfect, but should work):
execute a POST from iframe
retrieve the fil...
I have a struct:
typedef struct student
{
char fname[30];
char sname[30];
char tname[30];
Faculty fac;
int course;
char group[10];
int room;
int bad;
} Student;
I read it from the file:
Database * dbOpen(char *fname)
{
FILE *fp = fopen(fname, "rb");
List ...