fopen
Getting an error “fopen’: This function or variable may be unsafe.” when compling [duplicate]
This is not an error, it is a warning from your Microsoft compiler. Select your project and click “Properties” in the context menu. In the dialog, chose Configuration Properties -> C/C++ -> Preprocessor In the field PreprocessorDefinitions add ;_CRT_SECURE_NO_WARNINGS to turn those warnings off.
Create a file if one doesn’t exist – C
You typically have to do this in a single syscall, or else you will get a race condition. This will open for reading and writing, creating the file if necessary. FILE *fp = fopen(“scores.dat”, “ab+”); If you want to read it and then write a new version from scratch, then do it as two steps. … Read more
PHP check if file contains a string
Much simpler: <?php if( strpos(file_get_contents(“./uuids.txt”),$_GET[‘id’]) !== false) { // do stuff } ?> In response to comments on memory usage: <?php if( exec(‘grep ‘.escapeshellarg($_GET[‘id’]).’ ./uuids.txt’)) { // do stuff } ?>