I think the best approach is to break the permission string up into an array with each element of the array being a single character. Then a few "if" statements can handle those pesky suid, sgid and sticky bits. Once they are gone, what's left is really a binary number with hyphen being a zero and everything else being a one. We can then convert that binary number to octal. Finally we just add in any of those high bits we found.
Part of the problem may be that the OP has a PATH with some screwy versions of normal system commands. So setting the PATH is probably wise.
Here is a script that displays the numeric mode for a file that is passed as a argument...
Makaveli.2003, does this script work for you? And I too would like to know what "uname -a" and "echo $PATH" give you.
when i list the content of a directory
date informations are also listed (ls -ltr)
for included files and directories.
for example: i see the date Jun 29 14:43
for one of the included directory,
but when i look into the files contained in
this directory i cannot see any file with this... (1 Reply)
hi,
say I have
dirA/file1
dirB/file2
and I tar them up, and then do
zcat Tar.tar | tar tvf -
Sometimes I will see:
dirA/
dirA/file1
dirB/
dirB/file2
yet other times I will see (4 Replies)
Hello All,
Got a question to make a script what reads a directory and put the file names from that directory in a file with some extra text.
ls /tempdir
output is:
file1.gfh
file2.txt
file4.zzz
these file names (always with an extention) must be placed in a line and written to... (2 Replies)
Hi all,
Have to generate an xml having information related to files in the directory
Suppose i have file
file1.xml (datafile)
file2.xml (datafile)
file3.xml (metafile)
Now i need to generate an xml in the format >>
<?xml version="1.0" encoding="UTF-8"?>
<AuditFile Version="2.0">... (8 Replies)
Hi
i have a single line xml file having many account no tag, from which i need only the account no from the tag. any one can help on this.
below is the xml file:
... (2 Replies)
Hi to all,
I got this content/pattern from file http.log.20110808.gz
mail1 httpd: Account Notice: close igchung@abc.com 2011/8/7 7:37:36 0:00:03 0 0 1
mail1 httpd: Account Information: login sastria9@abc.com proxy sid=gFp4DLm5HnU
mail1 httpd: Account Notice: close sastria9@abc.com... (16 Replies)
Hi
I am trying to extract information out of a file but keep getting grep cant open errors
the code is below:
#bash
#extract orders with blank address details
#
# obtain the current date
# set today to the current date ccyymmdd format
today=`date +%c%m%d | cut -c24-31`
echo... (8 Replies)
I need my code to compare two different files that are in two completely different directories, How can I do this?
So for example, my code will look at file1 which is in my home directory, and compare the files with those from file2 that is in /abc/adf/adr/afc/adf/file2... does that make sense? (1 Reply)
I have a flat file that looks like this, let's call it Chromosome_9.txt:
FT /Gene_Name="Guanyl-Acetylase 9"
FT /Gene_Number"36952"
FT /Gene_Name="Endoplasmic Luciferase"
FT /Gene_Number"36953"
FT ... (4 Replies)
Hi Gurus,
I am SQL developer and new unix user.
I need to create some file and file content based on information in two files.
I have one file contains basic information below file1 and another exception file file2. the rule is if "zone' and "cd" in file1 exists in file2, then file name is... (13 Replies)
Discussion started by: Torhong
13 Replies
LEARN ABOUT DEBIAN
set_ucodepage
set_ucodepage(3alleg4) Allegro manual set_ucodepage(3alleg4)NAME
set_ucodepage - Sets 8-bit to Unicode conversion tables. Allegro game programming library.
SYNOPSIS
#include <allegro.h>
void set_ucodepage(const unsigned short *table, const unsigned short *extras);
DESCRIPTION
When you select the U_ASCII_CP encoding mode, a set of tables are used to convert between 8-bit characters and their Unicode equivalents.
You can use this function to specify a custom set of mapping tables, which allows you to support different 8-bit codepages.
The `table' parameter points to an array of 256 shorts, which contain the Unicode value for each character in your codepage. The `extras'
parameter, if not NULL, points to a list of mapping pairs, which will be used when reducing Unicode data to your codepage. Each pair con-
sists of a Unicode value, followed by the way it should be represented in your codepage. The list is terminated by a zero Unicode value.
This allows you to create a many->one mapping, where many different Unicode characters can be represented by a single codepage value (eg.
for reducing accented vowels to 7-bit ASCII).
Allegro will use the `table' parameter when it needs to convert an ASCII string to an Unicode string. But when Allegro converts an Unicode
string to ASCII, it will use both parameters. First, it will loop through the `table' parameter looking for an index position pointing at
the Unicode value it is trying to convert (ie. the `table' parameter is also used for reverse matching). If that fails, the `extras' list
is used. If that fails too, Allegro will put the character `^', giving up the conversion.
Note that Allegro comes with a default `table' and `extras' parameters set internally. The default `table' will convert 8-bit characters to
`^'. The default `extras' list reduces Latin-1 and Extended-A characters to 7 bits in a sensible way (eg. an accented vowel will be
reduced to the same vowel without the accent).
SEE ALSO set_uformat(3alleg4)Allegro version 4.4.2 set_ucodepage(3alleg4)