OK, I know next to nothing about scripting in unix, and at the moment I don't have access to a unix environment...
We have an application that generates a text report file which is later printed. The format is this:
bbtptcYYMMDDSSCC.txt (year/month/day/second/check digit)
I want a... (1 Reply)
Dear All,
I'm trying to write a script that searches thru a directory looking for a most recent file and then scp that file.
I have the scp working, but I don't know how to browse the directory and select the most recent file.
The file name includes a date & time stamp (e.g.... (3 Replies)
I need to change the name of a file within a script. For example I have two files. The first named scrnslc_0001 and the second scrnslc_0002. I want to change the name of the second to scrnslc_out. The appended number will change, and I won't know the file name in advance. If there were only one... (1 Reply)
Hi,
I have files coming in every day with that days timestamp like:
nameyyyymmddhhmmss.ext.
I need the most recent one and so i am using
cat `ls -t name*|head -1 ` > temp
i am sorting the files in the decending order and am copying the most recent one into a temp file.
It works at times... (3 Replies)
I want to find the most recent file containing ' NORESETLOGS"
I'm already here but, how to sort this now in a correct way ?
By the way, my version of find does not know about 'fprint'
find . -type f -exec grep -i " NORESETLOGS" {} \; -exec ls -l {} \; | grep -vi " RESETLOGS" (5 Replies)
Hi All,
I wish to get the most recent file from a dir which contains a specific string.
for example, in a dir sample/ , i have 3 files
file1.txt -- contains 'good'
file2.txt -- contains 'good'
file3.txt-- contans 'hello'
I want to search for the recent file (that is file2.txt) which... (3 Replies)
Hi guys,
Under my root directory there are many sub-directories which contains log file for every day of running.
How can I find , in one command only, the recent log file in each sub-directory?
For example, If I run the following:
find . -name "exp_prod_*_*_yes_*_.log" -exec ls -ltr {} \;... (12 Replies)
Dear,
Require a script to check :
If the file under /opt/OV/log directory has recent 5 hours(or user defined value) file generated or not
If generated then cmd to call :
opcmsg a=a o=o msg_grp=OpC msg_text="Log file didn't generated on $time" s=critical (1 Reply)
Hello Experts...
dir of FTP will list all the files in the directory. Is there any command or option of dir that will give me the most recent file only?
Since I couldn't find any such thing, I thought of creating a log file (of FTP results) and work on this log file to determine the most recent... (2 Replies)
Hi,
I need to find the most recent files by their name from an X repertoire.
The problem is that the name of the files is of type:
POWERL10_20151203000.xml
POWERL10_20151203001.xml
POWERL10_20151202000.xml
FIXED VALUE_DATENNN.xml
NNN = Sequential number
I would need to recover the... (4 Replies)
Discussion started by: verita
4 Replies
LEARN ABOUT OSX
pack_fopen
pack_fopen(3alleg4) Allegro manual pack_fopen(3alleg4)NAME
pack_fopen - Opens a file according to mode. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
PACKFILE *pack_fopen(const char *filename, const char *mode);
DESCRIPTION
Opens a file according to mode, which may contain any of the flags:
`r' - open file for reading.
`w' - open file for writing, overwriting any existing data.
`p' - open file in packed mode. Data will be compressed as it is written to the file, and automatically uncompressed during read opera-
tions. Files created in this mode will produce garbage if they are read without this flag being set.
`!' - open file for writing in normal, unpacked mode, but add the value F_NOPACK_MAGIC to the start of the file, so that it can later be
opened in packed mode and Allegro will automatically detect that the data does not need to be decompressed.
Instead of these flags, one of the constants F_READ, F_WRITE, F_READ_PACKED, F_WRITE_PACKED or F_WRITE_NOPACK may be used as the mode
parameter.
The packfile functions also understand several "magic" filenames that are used for special purposes. These are:
`#' - read data that has been appended to your executable file with the exedat utility, as if it was a regular independent disk file.
`filename.dat#object_name' - open a specific object from a datafile, and read from it as if it was a regular file. You can treat nested
datafiles exactly like a normal directory structure, for example you could open `filename.dat#graphics/level1/mapdata'.
`#object_name' - combination of the above, reading an object from a datafile that has been appended onto your executable.
With these special filenames, the contents of a datafile object or appended file can be read in an identical way to a normal disk file, so
any of the file access functions in Allegro (eg. load_pcx() and set_config_file()) can be used to read from them. Note that you can't write
to these special files, though: the fake file is read only. Also, you must save your datafile uncompressed or with per-object compression
if you are planning on loading individual objects from it (otherwise there will be an excessive amount of seeking when it is read).
Finally, be aware that the special Allegro object types aren't the same format as the files you import the data from. When you import data
like bitmaps or samples into the grabber, they are converted into a special Allegro-specific format, but the `#' marker file syntax reads
the objects as raw binary chunks. This means that if, for example, you want to use load_pcx() to read an image from a datafile, you should
import it as a binary block rather than as a BITMAP object.
Example:
PACKFILE *input_file;
input_file = pack_fopen("scores.dat", "rp");
if (!input_file)
abort_on_error("Couldn't read `scores.dat'!");
RETURN VALUE
On success, pack_fopen() returns a pointer to a PACKFILE structure, and on error it returns NULL and stores an error code in `errno'. An
attempt to read a normal file in packed mode will cause `errno' to be set to EDOM.
SEE ALSO pack_fclose(3alleg4), pack_fopen_chunk(3alleg4), packfile_password(3alleg4), pack_fread(3alleg4), pack_getc(3alleg4),
file_select_ex(3alleg4), pack_fopen_vtable(3alleg4), expackf(3alleg4)Allegro version 4.4.2 pack_fopen(3alleg4)