Programming :: Script To Create .menu File (recursively Read Directories)?

Nov 4, 2010

I've found myself in the situation where I need to create a menu in gnome/kde for a directory structure full of documents.The directory structure looks like this:

Code:
DOCS/
.. REFERENCES/

[code]...

View 1 Replies


ADVERTISEMENT

Debian Programming :: Using Glib To Create Menu File

May 12, 2015

I am using GTK and C and on my application I have a Drag and drop feature.

Code: Select allicon_view = gtk_icon_view_new_with_model(create_and_fill_model(pALP));
   g_object_unref(pALP->list_store);      /* destroy model automatically with view */
   gtk_icon_view_set_selection_mode(GTK_ICON_VIEW(icon_view), GTK_SELECTION_SINGLE);
   gtk_icon_view_set_reorderable(GTK_ICON_VIEW(icon_view), TRUE);
   gtk_icon_view_set_text_column(GTK_ICON_VIEW(icon_view), COL_DISPLAY_NAME);

[Code] ....

The drag and drop works fine but when I exit the application and enter again, the changes of the drops are not saved, meaning the new location is not saved. I understand that in order to save the location of the drops I need to create a menu file and write some xml, But how do I do this? it there another way?

View 0 Replies View Related

Programming :: Script To Create Some Directories To Organize Photos ?

Sep 15, 2010

I am trying to write a simple script to create some directories to organize photos.

Next I want to cd to the newly created dir DATE_BANDNAME, how can I do that?

View 4 Replies View Related

Ubuntu Servers :: Create Directories From A .txt File?

Feb 8, 2011

quickest way to create directories from a .txt or .csv file. A single command would be great but I can use a script as well.

The windows equivalent would be:

FOR /F %n IN (newfolders.txt) DO MKDIR %n

View 7 Replies View Related

General :: Create Directories From A File List?

Jun 30, 2011

I am trying to write a script to pick the directory name from a list of file. Here is a detailed picture.Have a file name LIST which contains the follwing for example/apps/oracle/product/test1/apps/oracle/product/test2/apps/oracle/product/test3I need a script that reads these line from LIST and creates foldersin /apps/oracle/product/test1/backup/date/test1 after reading the first line
/backup/date/test2 after readin the second line/backup/date/test3 and so on.

View 15 Replies View Related

General :: Removing Files Or Directories Recursively

Jan 29, 2010

The rm command man pages discusses removing files or directories recursively. So what is meant by deleting a file or directory recursively? And what are some reasons for doing so?

View 3 Replies View Related

General :: Chmod Change Only Directories Recursively

Mar 28, 2010

Is it possible to change only directories access permissions recursively with some linux command. I need to set x (access) permissions on directories but not execute on files. [URL]

chmod - change file access permissions
-R, --recursive
change files and directories recursively

View 2 Replies View Related

General :: Setting Sticky Bit Recursively Only On Directories

Jun 23, 2010

I have a folder that contains my group's website. The ownership of the entire directory is set to "www-data.website" (website being a group). I want to set the sticky bit on this directory such that if anyone creates a new file, either in the main directory or subdirectories, the ownership remains like above.

Q1: I have the sticky bit set on the main directory (drwxrwsr-x). But for some reason, some of the subdirectories don't have the sticky bit set. Is there a command I can use to change the sticky bit on Directories Only (i.e., not on the files)?
Q2: Is there a sticky bit that I can set for the ownership (not group) so that it is always set to www-data?

View 5 Replies View Related

General :: SSH Support - Searching Directories Recursively?

Jun 28, 2011

I promise I am carefully studying shell use, and much else, but right now I just need the shell instruction to search directories recursively, for files with .swo & .swp extensions, deleting the files as they're found.

View 7 Replies View Related

General :: Backup - Zip Selected Directories Recursively In Linux

Jun 25, 2011

I would like to zip only selected directories(and its child directories as well)I have many directories in the current folder like app, content, db, library etc.But I would like the zip only app and content and its child folders. I am trying the following.

zip -r ../backups/code/20110625 -i app/* -i content/* . *

But I am getting the following error. zip error: Invalid command arguments (nothing to select from)

What is the correct syntax to achieve this?

View 1 Replies View Related

Programming :: Finding Maximum Length File In A Directory Recursively Using Shell Scripting?

Nov 8, 2010

I want to find maximum length file in a given directory. It should search recursivley. I want this to be done using ls and simple looping constructs.

View 6 Replies View Related

Ubuntu :: Unable To Create Trashing Info File: Read-only File System

Jul 21, 2010

I plugged in my USb drive into my computer yesterday and tried to delete a folder. I was unable to do so and got the following message

Cannot move file to trash, do you want to delete immediately? The file "my file" cannot be moved to the trash. Show Details Unable to create trashing info file: Read-only file system

So when I click on delete I get another error message:

Error while deleting.
There was an error deleting Case Study Database. Show Details Error removing file: Read-only file system

At this point I can only click on Skip, Skip All, or Cancel.

I have not changed anything on the stick recently so I dont know what is causing the problem.

View 7 Replies View Related

General :: Command Line - Create Directories That Don't Exist While Creating A New File?

May 8, 2010

I can do:mkdir messages and then: touch messages/hello.txt Is there a command that will do both - create the directory if it doesn't exist, and then the empty file? Something like: touch -p messages/hello.txt

View 1 Replies View Related

Ubuntu :: Create Two Lists Of File Names Irrespective Of Directories And Compare?

Aug 13, 2010

I have an internal hard drive and an external hard drive, both with about 350 GB of data. The data came from the same source, but over the last couple of years, different people have moved files around to different directories, and some files have been deleted. Now I want to merge all the files onto the internal hard drive. I estimate that 80% of the files on the external hard drive are the same, so I don't want to copy 290+ GB of data over when I already have it.

Therefore, I need a way to find just the files on the external hard drive that don't already exist on the internal one. In other words, I need to create two lists of file names irrespective of directories and compare them, selecting only the file names that exist in one list OR the other. I've Googled for solutions but can't find anything suitable. There are ways to create text files of the file names and compare them with diff, but they have to be in the same order, and since these files are in vastly different directories, that won't work.

View 5 Replies View Related

General :: Make All Files Non-executable Recursively Using Find Without Affecting Directories?

Sep 26, 2010

I need to strip the executable flag from all files within a certain directory and sub directories. Right now I'm doing it with a 2 step process

find /dir/ -type f -exec chmod ugo-x {} ;
find /dir/ -type d -exec chmod ugo+rx {} ;

Is it possible to modify the first line so that I can strip exec flag from all non-directory files? Since this needs to be done on a fairly regular basis across a lot of directories and files, I'd prefer not to use a bash script which would slow it down.

View 1 Replies View Related

General :: Command For Listing Files/dirs Recursively Of Specific Directories?

Jul 22, 2011

suppose in my current directory, I have 50 sub-directories. Now, I am interested only in about 20 of those sub-directories (whose names match a pattern). I would like to recursively list the contents of these 20 sub-directories. How do I do that ? I would like to do this in Solaris 10 and Linux(RHEL 5.x).

View 3 Replies View Related

Fedora :: Cannot Create Regular File Read Only File System?

Jun 16, 2009

All my torrents go to my home/username/Download/ folder, I could read/write yesterday but now I cant even copy the files to a flash drive.The error i get is "Cannot create regular file '/home/username/Download/file' : Read only file system.

View 14 Replies View Related

General :: Create A Backup Directory And 3 Directories Within That And Some Files Within The 3 Directories And Then Back Them Up Ot Restore Them?

Dec 19, 2009

i am in need of linux help. iam at college and i need this back/restore script to pass this final part of an assessment. i require a backup script that will not only backup but also restore files to the relevent directories. e.g. users are instructed to store all wordprocessor files in a directory named wp. so i am needing to create a backup directory and 3 directories within that and some files within the 3 directories and then back them up ot restore them. l know i should/have to do this myself by been trying to get/understand info for the last few days and came up with zero.

View 14 Replies View Related

General :: Multiple Users To Create Directories Over SFTP So The New Directories Keep The Same Permissions?

May 15, 2011

I want to make a webserver with multiple users allowed to login through SFTP to a specific folder, www.Multiple users are added, lets say user1 and user2, and all of them belonging to the www-data group. The www directory has an owner www-data and a group www-data.

I have used chmod -R 775 on the www folder, but after I try to create a folder test through my SFTP server (using Filezilla) the group of the directory created has only r and x permissions, and I am not able to log in with the second user user2 and create a directory within www/test due to a lack of w permission to the group.

I also tried using chmod 2775 on www directory, but without luck. Can somebody explain to me, how can I make it so that a newly created directory inherits the root directory group permissions?

View 2 Replies View Related

General :: Recursively Set Read-only Permissions?

Oct 5, 2010

I have a very large and deep directory. I would like to make all of it read only. The problem is I guess I have to distinguish between files (which will get a=r) and directories (which will get a=rx).How can I do that?

View 3 Replies View Related

Programming :: Searching File In Directories?

Feb 23, 2011

I am trying to search particular directory which has files with extensions like .html,.mp3,.xml etc I have a list of such files

What I am doing in my script is

for file_name in `find /home/ -name index.html -o -name song.mp3 -o -name help.xml`;
do
if [ $file!='' ]
then

[Code].....

View 4 Replies View Related

Programming :: How To Find Directories That Do Not Have A Certain File

May 28, 2010

I'm having problems figuring out the process to find directories that DO NOT contain a certain file. I have a mp3 collection that all the album art is name "folder.jpg". Not all the albums have images. I need a way to find the albums/directories that do not contain "folder.jpg". I can find the ones that do contain "folder.jpg" with

Code:
find . -iname 'folder.jpg' -print0 | xargs -0 ls >> album_art

but that is as far as my bash-fu can take me. I'm not really sure what my next step is.

My directory structure is like such: a-z/artist/album/folder.jpg

View 5 Replies View Related

General :: Recursively Add Read Privilege To All The Files Under A Certain Directory?

Jan 18, 2010

I'm under linux . by default, other user can't read anything under my home directory. let's see my home directory is /home/superman , and I tried to use

chmod +r /home/superman

to let others can acess files under my home directory , but it does not work .

View 1 Replies View Related

Programming :: How To Create A Menu In C Like Bash's Select

May 23, 2011

Im wondering how to create a menu in c like bash's select. I imagine there is already something out but I don't know what it would be. Im a c newb but been scripting for a long time now and trying to pick up a little c.this would be what I am looking to display:

Code:

1) option 1
2) option 2
3) option 3

Make a selection:obviously 1,2,3 would be the only valid selection and anything else would say invalid or something like that.

View 2 Replies View Related

Programming :: Create A Multi Selection Menu?

Sep 18, 2010

I am creating a program that need menu with multi selection option for shell (CLI).I am using of Bash scripts.something that will look like that:

Menu:
[ ] option 1
[x] option 2

[code]...

View 2 Replies View Related

Programming :: Create A Separate Thread For Program Which Basically Polls Using The Read Command?

Sep 28, 2010

I'm trying to create a separate thread for my program which basically polls using the read command. However this new thread seems to block the main thread, anyone know why this could happen.

In main I call this function pthread_create(&mainEventThread, NULL, GenericEventThread, NULL);

which calls
/*New threads start function */
void *GenericEventThread()
{
short int i, nError = -1;

[Code]...

I've used pthread_self to check that a new thread is being created, so why is the while loop in one thread blocking the main thread from running, I haven't used the join function anywhere in my code.

View 2 Replies View Related

Programming :: Check That The Same File Exists Within Two Different Directories Using A Filename As A Variable?

Apr 30, 2010

I am in need of a way to check that the same file exists within two different directories using a filename as a variable. Here is the process which requires it: The script is reaches out (via ftp) and pulls down a file(s) and delete it afterwards. This is halfhazard because in the instance it doesnt pull down the file, yet still deletes it, we are up a creek. I am looking to pull it down to a temp location and then verify that file exists in the location in which it needs to be present to process before deleting it, adding a little extra layer for security. The script itself is finished.If I put a file name in manually it works perfect. I just need a way to pump the filename into the variable.

View 1 Replies View Related

Ubuntu :: Create A Menu.lst File From Scratch?

Feb 6, 2010

i have just installed ubuntu 10.04 dvd version and ho and behold grub error 15 just amazing any way i enter the partition via live cd thinking i edit the menu.lst file and that it but the folder grub it completly empty what is going here and how can i fix this?

View 9 Replies View Related

Programming :: Splitting A File Based On The Values Read From An Input File?

Jul 27, 2010

I am splitting a file based on the values read from an input file. The below one is the script.

1)How do I add the header which is present in the original file to the new split files created?(For eg. pharmacyf conatins header as table column names. The new files created (ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat) are without the header).

2) Also the script is creating 0 byte files for the pharmacyids which are not available in the intial file? Can this be avoided?

for pharmacyf in *
do
tablename=`echo $pharmacyf |cut -f4 -d'.' `
while read pharmacyid
do
grep -w $pharmacyid $pharmacyf >> $OUT/ODS.POS.$pharmacyid.$tablename.$CURRENT_DATE.dat
done< inputfile
done

View 2 Replies View Related

Programming :: Create A Simple Program With Will Continually Read Input From The User Until They Enter A Blank Line?

Apr 6, 2011

basically i have to create a simple program with will continually read input from the user until they enter a blank linei know how to read in certain input but not sure how to get it continually in a loop

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved