Software :: How To Get File Permission As Digits
Jun 28, 2010
I am trying to write a program that gets file permission. I understand linux has ls -l can view file permission, but it has too many information that I have to process those strings in my program. Is there an easier command just return me the permission digits like:
$ getperm /home/file
0440
$
View 1 Replies
ADVERTISEMENT
Jun 20, 2011
I have many files with name in order of number. e.g)
u0101.asc
u0102.asc
u0103.asc
[code]...
I am trying to read file using for loop.
for ((date=01; date<=31; date++))
do
echo ${date}
done
but '01' is read(print) as '1' How can I make it read from '1' to '01'?
View 6 Replies
View Related
May 18, 2011
I'm using ubuntu 11.04, I'm having some problem of ownership while sharing folder/files. to share i change the folder share option:1. Share this folder, then followed by 2.allow others to create and delete files in this folder3. guest access.Now if someone in my local network edit any file and save it, it gets locked. if some one copy their file in this folder the permission is marked as "no group" "no owner". and they get unaccessible to me. i tried doing chown <user> <folder> but it says Operation not permitted. Now how i can possibly share my folder on local network so that they can be edited by others without getting locked down , if they copy files i can able to modify them.
View 2 Replies
View Related
Mar 27, 2011
how much big number can be managed by gmp library under plain GCC environment? (does GMP cover infinite length of integer?)
View 1 Replies
View Related
Jul 7, 2011
I'm having a hard time trying to get the number of digits in a uint64_t variable. The reason I'm using this is I want to make sure I get x amount of digits inside of a variable before I use it, but since the higher the digits, the better the program is.I currently use the following code, and it works, but my loop will never exit because the length is always 0:
Code:
/**
* numbdigits()
* number: The number to evaluate [in]
*
* Returns the number of digits found in a number.
[code]....
getrand() returns a uint64_t as well (and works). The only way the while() loop ends without my intervention is if I do curd += numdigits(val) instead...but, that gives a false value as well.
View 7 Replies
View Related
Aug 29, 2010
I am trying to replacee all digits with a symbol (say, big U here) in a string by
[code]...
The result become 'UsUoUmUeUtUhUiUnUgU' instead of 'somethingUUU' as expected. Looks like my string contains some 'hidden digits' in between the letters. Does anyone have an idea about that?
View 2 Replies
View Related
Apr 8, 2010
I am having a huge problem checking the data I input to make sure it is correct. What I am trying to achieve is when I input a value, it will check if the input is all digits and if it is not, check to see if it contains certain alphabets. Thus for example, if I were to input in data such as "11A" , the program will then inform me "There is an important alphabet in the program." This would be my expected output. Here is the program I have wrote...
Code:
int test(string r ){ const int arraySize = 10;
char array2[arraySize2] ={'A','B','E','F','G','H','J','K','N','O','P','Q','R','S','T','U','W','Y','Z'};
for(int cntr = 0; cntr <r.length(); cntr++)
if(!isdigit(r[cntr])){ for(int new1 =0; new1<arraySize2;new1++)
for(int cntr1 = 0; cntr1 <r.length(); cntr1++)
if(array2[new1] == r[cntr1]){ return 2; //will return2 when it finds the same
// char in the array and the string r. } else{ return 3;
//will return 3 when there is a char
//in the string which isnt in the array
} } else { return 1; // will return 1 when string is all digit.
} int main() { string r = "11D"; test(r);
if(test(r) == 1) { cout << "ALL ARE DIGITS" << endl;
} if (test(r)== 2) {
cout << "There is an important alphabet in the program." << endl;
} if (test(r)== 3) { // testRoman(r);
cout << "There is an Alphabet in the String which is not in the Array" << endl;
} }
So, the problem I am facing is when I input in data such as 11 or A , the prog will come out the right input. But if I were to put in data such as "11A" , the output coming out will be "ALL ARE DIGITS". The problem which causes this seems to be in the return statement , as once as it finds the first char which is a digit, it will then return 1 and not continue checking the rest of the string. Is there a way I can stop or continue a loop if it has met the condition I stated? What I can do or any other way available for me to check my input?
View 4 Replies
View Related
Jan 1, 2010
I want to count the digits in between the text in a file.
e.g.
write down the form
2.3 3.3 3.0 505.0 0.777E-07
22.3 3.3 5.0 503.0 1.777E-04
Then read this.
How can i do the counting of these digits present in between a text in a file?
View 9 Replies
View Related
Nov 29, 2009
My problem is this:I have a number of directories, all containing files of different name lenghts, including letters, numbers and possibly spaces. I want to recursively rename all of these files, so that only the _last_ 5 digits (not counting the extension) remain. In other words: I want to cut off all but the last 5 digits and not touch the extension.
I've tried to read up on tr, rename (perl version), sed, cut etc. and browsed through some threads here, but so far couldn't quite figure out how to do it.
If someone could point me to the right (standard) CLI tools and syntax.
View 2 Replies
View Related
Oct 18, 2010
I have a C-function that create a file and then make a copy in the same directory, but somethin is wrong with permission or owners.The program starts as root user.The file creates by the program:
-rwxrwxrwx 1 root staff 199680 Oct 18 10:58 test
Ok, but after copying the permission is not the same.The file after copying (with new name) by the program:
-rw-r--r-- 1 root root 199680 Oct 18 10:58 test_copy
I want to have full permission of the copy, how to do??
View 2 Replies
View Related
Dec 16, 2009
Suppose I have a binary program with only execute permission enabled for the current user. How (in general) would I be able to obtain a core dump of the file? I think I have read it somewhere but I want to know if there are more ways of doing it.
View 1 Replies
View Related
Feb 27, 2011
Im trying to run a program but my system won't let me.i used to be able to run executable files without a problem but i can't anymore when i double click the file i get "there is no application installed for executable files" i am unable to check "allow executing file as program" in file properties there is a script file which runs the program but all i get from the terminal is "permission denied"
View 14 Replies
View Related
Feb 4, 2010
What are the possible problem when Windows access the file from Ubuntu got Read Only even though have a full permission to read, write and execute the file? Ubuntu to Ubuntu accessing the file there is no problem only Windows got a problem.
View 1 Replies
View Related
Jul 18, 2011
i have two different systems having centos and slackware OS's.when i mount files on centos system from server, i get all permission on files means(rwx),but when i execute same command on my slackware system, i get only read permission on file.
i use mount -t cifs //serverip/sheetshare /root/Desktop/sheet/ -o username=abc,password=abc.
View 1 Replies
View Related
Feb 20, 2011
I hate ubuntu because EVERYTHING i need a permission. How can i edit an stupid file? Said i have no permission. **** IM THE ADMINISTRATOR, HOW CAN I HAVE TOTAL CONTROL ON MY COMPUTER -.-' ?
View 9 Replies
View Related
Jun 7, 2011
How can hide it ?Or unless to request a password?I want to do this because Sometimes My cousins use my PC and I don't really want to set an account for each one so I let them use the mine.Problem is I have important files that i don't want to hide but to make them unerasable (I doubt that word exist though)I mean to not let them erase them but some are pretty clever and they Know of the properties option so they can change the attributes.
View 5 Replies
View Related
Jan 18, 2010
how is the file permission is defined?
for example when i use the command list -l testp01.txt i get the result of testp01.txt file permission -rw- r-- r-- root root etc however i wonder where are those information written?
is there any special file which contains all of these information?
View 7 Replies
View Related
Sep 26, 2010
I am creating a DVD iso of the mentioned six .iso file using 'mkisofs' in CentOS. During the process, at about 12%, an error occurred. The error was that: "Cannot read from '/sys/firmware/acpi/namespace/ACPI/_SB/PCI0/P2P0/S4F0/eject'" I remembered setting all the permissions to "read and write" but I kept receiving the same error next time.
View 1 Replies
View Related
Jul 17, 2011
I have been trying to to make the folder "/home/files" Read/write/Execute for the group "admin" and only Read for Group "Friends"
View 4 Replies
View Related
Nov 25, 2010
I am trying to change the owner permission of file as "read only" when the file is rcp remote copy ) from server to another for security reason. Any way to change to permission as readonly access for owner and group ( 550 )when transfer the file using the rcp command ? I tested but still retain the original permission as source file.
Version : RHEL 5.2
Command : #rcp(local file)(/destinationserver/
/folder/file)
[code]....
View 3 Replies
View Related
Jan 11, 2011
Is there any use if a file has only write and execute permission and not read permission?
View 2 Replies
View Related
Apr 24, 2011
If I am not the file' owner or root, can I use chmod to change the file permission?
Assume I have group/write access to the file, e.g. 775
View 2 Replies
View Related
May 12, 2011
My shell script runs from the command line, but fails in cronjob. /bin/sh: asper.sh: Permission denied
-rw-r--r-- asper.sh I guess the permission should look like '-rwxr-xr--' How can I change the permission to be like that?
View 2 Replies
View Related
Feb 10, 2010
What does chmod 000 do?when i create a chmod'd file with the 000 permission what happens?I tried creating a file with 000 permissions, and I was still able to read and write to it. So what what does chmod 000 actually do?
View 6 Replies
View Related
Jan 20, 2011
i was install ubuntu server with desktop and when i try to open my ip adress in browse it show me this
Forbidden
You don't have permission to access this file on this server. Cheyenne/2.2.8 Server at localhost Port 80.how can i fix it.My IP address is 88.163.109.209, you can see the directory forbidden error if you type in my IP address.
View 3 Replies
View Related
Feb 8, 2011
Sudo echo fuse >> /etc/modules
Any idea why that'd yield a "bash: /etc/modules: Permission denied" error? Here's what "stat /etc/modules" says code...
View 1 Replies
View Related
Jun 5, 2011
i have check a file permission with sshand i get : drwxrxwrwxwhat is "d" ?
View 2 Replies
View Related
Sep 15, 2010
My cd /boot/grub/ shows (required only file shown): -r--r--r-- grub.cfg
I tried to change the permission of this via, chmod u+w grub.cfg but the file permission did not change why??
How can I change the file permission of grub.cfg?
View 1 Replies
View Related
Oct 13, 2009
using a terminal
logged into userMan remotely
[code]
scp /file.txt xxx.xxx.xx:/home/userMan/
[code]
Is the syntax above correct?
I'm trying to copy /file.txt from local machine, to server with userMan
error: /file.txt doesn't exist
View 8 Replies
View Related
Jan 13, 2011
i have created a file (by root user) called test.txt. Then i created a user bob. Now i want only bob to read/write/execute this file and no other user shall have any permission on it.
View 3 Replies
View Related