Sort vector by file or folder

I have a vector that is returning a directory and all of its contents (files and folders). I need to sort it so the folders will be listed first then the files. I believe I have to comparison but am not sure how. I am very new to java so examples would be great.
tks

You need to either implement Comparable.compareTo or Comparator.compare.
The comparison method will first check the types of the objects. If one is a folder and one is a file, have it return 1 or -1, depending on which was which.
If they're both files or both folders, then you return the results of comparing their names (or whatever other attirbute you want to sort on).
http://www.onjava.com/lpt/a/328

Similar Messages

  • Auto selection of file from folder during uploading??

    Hi all friends,
    Iam facing with one problem I am developing one uploading software for that i have used swing and servlet.Now my problem is i want to give auto selection of file from one folder means user just copy the files from any computer on network and paste it in predefind folder.And when they click on upload button it should start uploading of file one by one and after completion of uploading it move that file into another folder one by one.Now my software doing it perfectly but if user copy and paste any file in that predifined folder from network computer during uploading then they have to click upload button again after completion of first queue of files(for example if user first copy 10 files and start uploading and inbetween uploading of that 10 files if user copy another 10 files from network computer then they have to click on upload button again after completion of uploading of first 10 files).But my user requirement is they want to click on upload button once only at the time of starting my application and my application automatically select the file one by one from folder and send it to destination.Means if they copy the file from network machine inbetween uploading or any other user from network send file in that folder then my application should select those file automatically and start uploading means they don't want to click on upload button again.Can any one plz guide how I can slove this problem.Below r my codes:-
    Upload.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    try {
    suspendflag=true;
    Resume.setEnabled(false);
    Suspend.setEnabled(false);
    dest=frame.m_txtURL.getText();
    File ff=new File("d:\\DTMS\\Upload");
    File[] files = ff.listFiles();
    fileList = new Vector();
    if(files == null)
    textArea.append("There is no file");
    return;
    else
    for (int j = 0 ; j< files.length ; j++)
    fileList.add(files[j]);
    java.util.Collections.sort(fileList, new FileComp());//sorting by size
    new Thread(new Runnable() {
    public void run(){
    for (int k = 0; k < fileList.size(); k++)//loop for queue {
    File fname = (File)fileList.get(k);
    String str=fname.getName();
    log("Destination:" +" "+ dest);
    log("Uploading Progress\nPlease Wait....");
    result=doPost(fname,dest);//method for read file & send to servlet
    String str2="Transfer apparently failed.";
    String str3=result;
    if(str2.equals(str3)){
    Error(result);
    else if(suspendflag==true){
    File newfile =new File("d:\\DTMS\\Archives\\"+str);
    fname.renameTo(newfile);
    log("File" +" "+ str+" "+"Upload Completed !");
    else if(suspendflag==false){
    Error("** Transfer Suspended**");
    }).start();
    }catch(Exception exp)
    Error("Error : " + exp.toString());
    Regards
    Bikash

    Hi Chandan,
                        All the multiselection files are stored in it_tab( i:e file_table in method). you need to loop the every record to upload the data for selected files. please check the code Below...
    DATA: file_str1 type string.
    data: it_tab TYPE STANDARD TABLE OF file_table,
           wa_tab TYPE file_table,
           lw_file LIKE LINE OF it_tab,
           gd_subrc TYPE i.
    SELECTION-SCREEN begin of block blk with frame title text-100.
    SELECTION-SCREEN SKIP 2.
    parameters : p_file like rlgrap-filename .
    SELECTION-SCREEN end of block blk.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
    window_title = 'Select only Text File'
    default_filename = '.azt'
    multiselection = 'X'
    CHANGING
    file_table = it_tab
    rc = gd_subrc.
    *READ TABLE it_tab INTO lw_file INDEX 1.
    *p_file = lw_file-FILENAME.
    Start-of-Selection.
    loop at it_tab INTO wa_tab.
       file_str1 = wa_tab-FILENAME.
    CALL FUNCTION 'GUI_UPLOAD'
       EXPORTING
         filename                      = file_str1
    *    filename                      = '\\10.10.1.92\Volume_1\_projekte\Zeiterfassung-SAP\test.azt'
       tables
         data_tab                      = it_string
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDLOOP.

  • Using a Vector Art File as a matte for an image collage

    II have a vector art file of a paw print.  I would like to use it with a variety of photos to create a collage.  I have the image files selected and the vector art file sized, but what I can't figure out is how to have the images seen ONLY inside each toe/pad of the paw print.  Once the file is completed, I would like to be able to flow text around the paw prints so I don't want the entire art board area to be white as this would effect my text wrap properties. Any and all suggestions are welcome!
    Ubiquitous Information:
    Adobe CS6 Design & Web premium
    Illustrator v. 16.0.3 (32-bit)
    Windows 7 Professional sp 1 64-bit OS
    Thanks in advance for your help this morning!
    Susan

    I developed a Photo Collage Toolkit for Photoshop.  I feel its very easy to create PSD templates that can be populated with images.
    Photo Collage Toolkit
    Photoshop scripting is powerful and I believe this package demonstrates this video showing a 5 image collage PSD template being populates with images:
    The package includes four simple rules to follow when making Photo Collage Template PSD files so they will be compatible with my Photoshop scripts.
    Size the photo collage templates for the print size you want - width, height and print DPI resolution.
    Photo collage templates must have a Photoshop background layer. The contents of this layer can be anything.
    Photo collage templates must have alpha channels named "Image 1", "Image 2", ... "Image n".
    Photo collage templates layers above the background layers must provide transparent areas to let the images that will be placed below them show through.
    There are twelve scripts in this package they provide the following functions:
    TestCollageTemplate.jsx - Used to test a Photo Collage Template while you are making it with Photoshop.
    CollageTemplateBuilder.jsx - Can build Templates compatible with this toolkit's scripts.
    LayerToAlphaChan.jsx - Used to convert a Prototype Image Layer stack into a template document.
    InteractivePopulateCollage.jsx - Used to interactively populate Any Photo Collage template. Offers most user control inserting pictures and text.
    ReplaceCollageImage.jsx - use to replace a populated collage image Smart Object layer with an other image correctly resized and positioned.
    ChangeTextSize.jsx - This script can be used to change Image stamps text size when the size used by the populating did not work well.
    PopulateCollageTemplate.jsx - Used to Automatically populate a Photo Collage template and leave the populated copy open in Photoshop.
    BatchOneImageCollage.jsx - Used to Automatically Batch Populate Collage templates that only have one image inserted. The Collage or Image may be stamped with text.
    BatchMultiImageCollage.jsx - Used to Automatically Batch Populate Any Photo Collage template with images in a source image folder. Easier to use than the interactive script. Saved collages can be tweaked.
    BatchPicturePackage.jsx - Used to Automatically Batch Populate Any Photo Collage template with an image in a source image folder
    PasteImageRoll.jsx - Paste Images into a document to be print on roll paper.
    PCTpreferences.jsx - Edit This File to Customize Collage Populating scripts default setting and add your own Layer styles.
    Documentation and Examples

  • [JS CS3] About Number of files in folder.

    Hello,
    Is there any way to get number of files in a folder using javascript?.
    I am going to locate the folder and then i want to create a script that will give number of files in that folder.
    Thank you,
    --Avi

    > Is there any way to get number of files in a folder using javascript?.
    There are a couple of different ways. Here's the most concise I can think of:
    folder.getFiles(function(f) { return f instanceof File; }).length
    But you really do need to read the docs if you are going to be working with File
    and Folder objects.
    -X
    for photoshop scripting solutions of all sorts
    contact: [email protected]

  • Sorting photos by file size

    When I switched from my PC to the Mac the photos that were imported from my Picasa backup created more than one file, sometimes 3 of each image! I need to be able to start organizing my photos and I really need to delete the smaller images. I can not figure out how though, and it is driving me insane!!! Not to mention chewing up a TON of disk space!
    HELP!!!!!
    How do I sort by image/file size so I can delete them?!?!? (And not screw up and delete a precious photo of my kids as infants?)
    MacBook   Mac OS X (10.4.9)   Formerly Win 2000 PC

    zzwhitejd:
    Welcome to the Apple Discussions. It may be how Picassa and windows handles thumbnails as opposed to OS X. When you imported directly from the PC you might have imported the support files that, on the Mac, contained in the Resource Fork of the file. If you can try copying some of the files again to a folder on the desktop first and see what you get in the way of the number of files.
    To get rid of those duplicates already in the library you can try using Duplicate Annihilator or iPhoto Diet. In either case make a backup copy of the iPhoto LIbrary folder just in case the results are not what you expected.
    Do you Twango?
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    I've written an Automator workflow application (requires Tiger), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.

  • Sort order of file names in list windows

    Why is the sort order of file names in the File > Open File...
    list window other than in a normal Finder list window?
    Example:
    File > Open...:
    @@@2Know.pages
    @@@2KnowQ.pages
    @@@@@2Do.pages
    @@@@eBayAmaz.pages
    @@@@pws.pages
    @@@@Sold-DE.pages
    @@@@Sold-UK.pages
    Finder Window:
    @@@@@2Do.pages
    @@@@eBayAmaz.pages
    @@@@pws.pages
    @@@@Sold-DE.pages
    @@@@Sold-UK.pages
    @@@2Know.pages
    @@@2KnowQ.pages
    How could both lists be displayed equal?
    Thanks!

    Run this short script
    set theFolder to choose folder
    set theNames to list folder theFolder
    set texte to ""
    repeat with n in theNames
    --set n to n as text
    set texte to texte & n & return
    repeat with i from 1 to count of n
    set texte to texte & (ASCII number of character i of n) & " , "
    end repeat
    set texte to texte & return
    end repeat
    set p2d to path to desktop
    set rapport to "the characters.txt"
    tell application "Finder"
    if exists file rapport of p2d then delete file rapport of p2d
    set theRapport to (make new file at p2d with properties {name:rapport})
    end tell
    write texte to (theRapport as alias) starting at 1
    navigate to the folder whose list seems curious.
    You will get a file named "the characters.txt" on the desktop.
    It will show the code of every character embedded in fileNames.
    My guess is that there are some control characters which aren't treated the same by the open dialog and by the Finder.
    Here is an example:
    .DS_Store
    46 , 68 , 83 , 95 , 83 , 116 , 111 , 114 , 101 ,
    base Kbase - copie 1.cwk
    98 , 97 , 115 , 101 , 32 , 75 , 98 , 97 , 115 , 101 , 32 , 45 , 32 , 99 , 111 , 112 , 105 , 101 , 32 , 49 , 46 , 99 , 119 , 107 ,
    base Kbase - copie.cwk
    98 , 97 , 115 , 101 , 32 , 75 , 98 , 97 , 115 , 101 , 32 , 45 , 32 , 99 , 111 , 112 , 105 , 101 , 46 , 99 , 119 , 107 ,
    base Kbase.cwk
    98 , 97 , 115 , 101 , 32 , 75 , 98 , 97 , 115 , 101 , 46 , 99 , 119 , 107 ,
    exemple wKbase
    101 , 120 , 101 , 109 , 112 , 108 , 101 , 32 , 119 , 75 , 98 , 97 , 115 , 101 ,
    Icon
    73 , 99 , 111 , 110 , 13 ,
    safe
    115 , 97 , 102 , 101 ,
    scripts pour Kbase
    115 , 99 , 114 , 105 , 112 , 116 , 115 , 32 , 112 , 111 , 117 , 114 , 32 , 75 , 98 , 97 , 115 , 101 ,
     w_Kbase vers AW.scpt
    240 , 32 , 119 , 95 , 75 , 98 , 97 , 115 , 101 , 32 , 118 , 101 , 114 , 115 , 32 , 65 , 87 , 46 , 115 , 99 , 112 , 116 ,
    Yvan KOENIG (from FRANCE samedi 7 mars 2009 23:14:15)

  • How do I sort my individual files?

    I will try to be as descriptive as I can. I have a MacBook Pro running OSX 10.9.1. I have searched the community and will continue to do so.  I am having no success in sorting my photo files. First, I go into Finder. I then select my drive. From the next column I then select the folder where the files I want are located. I have these folders named by date. I select the date I want and there is my list of, let's say, 100 files. They are half jpeg and half CR2 (raw) and are listed as follows:
    File 1 jpeg
    File 1 CR2
    File 2 jpeg
    File 2 CR2
    File 3 jpeg
    File 3 CR2, etc., etc. through 100.
    I want to organize them by size so that all jpegs are first (1-50) and then the raw files second (51-100). However, even highlighting them and telling the computer to sort by size, it does nothing but sort the folders in the previous column. I have thousands of CR2 files I potentially want to delete so I need to be able to sort in this manner. Any guidance that can be provided would be greatly appreciated.  I swear I was able to do this previously irrespective of list view, icon view, etc. simply by selecting the entire list and choosing my sort/arrange either by kind or by size (as all CR2 files are significantly larger than even the largest jpeg.  Thanks in advance.

    Based on some earlier suggestions by others, I finally figured this one out, and it works perfectly every time.  I just deleted thousands of RAW files easily from iPhoto since I edit those with Lightroom on my desktop and now I have only the JPEGs on my Mac Air, saving tons of hard drive space.
    Do this: In Finder / View / Show View Options / Arrange by:  Name and Sort by:  Size.  Check all fields you wish to see displayed, e.g., name, date created, etc..  Now open iPhoto and select Events.  You will need to perform the next series of steps individually for each desired Event, one at a time.  My procedure didn't work when I tried it for All Photos, for example.  Now click on an Event album that you wish to delete a file type, e.g., RAW, JPG, MOV, etc.  Click File / Reveal in Finder / Original File.  Finder will display all file names in the selected Event in a pop-up window.  Now simply highlight the files you wish to delete and then Move to Trash.  Empty Trash.  They are now gone!  Repeat for other desired photo Event albums.
    Hope that helps.

  • Can you sort images by file size?

    Is there any way to sort pictures by file size in iPhoto '08? I couldn't figure it out, but maybe I'm just an idiot. Thanks in advance for your help.

    No - there is no way to sort by size
    the only current sort options in iPhoto are under view menu ==> sort photo ==> by date, by keyword, by rating, by title, manually (only works in Photos display mode with event titles off as of now)
    Suggestions for new features o iPhoto menu ==> Provide iPhoto Feedback
    You can see the sizes by right clicking on the iPhoto library in the Pictures folder and selecting show package contents -- you should not modify the contents - this might cause iPhoto to get confused and cause problems uncluding losing photos (or at least not being able to see them in iPhoto)
    Larry Nebel

  • How can I sort a sequence files into two new folders in Automator?

    I have a folder with 2000 files. I need to sort these files into two folders. I have sequentially renamed the files in automator so that a number is the first character of each file. I need to put the odd numbered files in folder one and the even numbered ones in folder two.
    I can do this sort in a spreadsheet. How do I get the resuls of the spreadsheet sort back into automator?
    Or is there a better way to do this within Automator?
    G4 17 PB   Mac OS X (10.4.2)  

    Open the Script Editor in the /Applications/AppleScript/ folder and enter the following:
    tell application "Finder"
    set source_folder to folder "folder:with:2000:items"
    set folder_1 to folder "folder 1"
    set folder_2 to folder "folder 2"
    repeat with this_item in (get items of source_folder)
    if (item 1 of (get name of this_item)) mod 2 is 1 then --odd number
    move this_item to folder_1
    else
    move this_item to folder_2
    end if
    end repeat
    end tell
    Insert the paths to the actual folders in lines 2, 3, and 4.
    (14737)

  • Sort jpgs via file list?

    Would is be possible to write a custom manual bridge sort file (hidden file)?
    The  idea would be able take a list of jpegs in a specific order and get  Bridge to to sort them according to the order on the list via preserved filename metadata.  Say an ordered list of images for an animated sequence?
    Any advice and or a script would be great!
    Thanks!

    Hope this will help you, this code expects you to have a TEXT file with a list of filenaames that willl be used to sort the selected folder.
    N.B. The text file MUST have the names of the files in SAME case as on disk.
    Example: mypicture.jpg (in the text file ) is not the same as MyPicture.jpg on the disc. They must be the same!
    #target bridge
    if( BridgeTalk.appName == "bridge" ) { 
    var sortWithTextFile = new MenuElement( "command","Sort on TXT file", "at the end of Tools" , "txtsort" );
    sortWithTextFile.onSelect = function () {
    var txtFile = File.openDialog("Please select TEXT file.","TXT File:*.txt");
    if(txtFile == null) return;
    var fileNames = new Array();
    txtFile.open('r');
    while(!txtFile.eof){
    var line = txtFile.readln();
    if(line.length <4) continue;
    fileNames.push(line.toString().replace(/^[\s]+|[\s]+$/g, ''));
    txtFile.close();
    var fileSort = new File(app.document.presentationPath +"/.BridgeSort");
    var fileNames2 = new Array();
    if(fileSort.exists) fileSort.remove();
    var fileList=[];
    for(var f in fileNames){
    var tmpFile = File(app.document.presentationPath + "/" + fileNames[f].toString());  
    if(!tmpFile.exists) continue; //Ignore files that do not exist, better to create an error file.
    fD = File(tmpFile).created;
    var FileDate = fD.getFullYear() + (zeroPad(fD.getMonth() +1,2).toString());
    FileDate += (zeroPad(fD.getDate(),2).toString()) +  (zeroPad(fD.getHours(),2).toString());
    FileDate += (zeroPad(fD.getMinutes(),2).toString()) + (zeroPad(fD.getSeconds(),2).toString());
    fileList.push([[decodeURI(tmpFile.name)],[FileDate]]);
    app.document.sorts = [{ type:"string",name:"name", reverse:false }];
    fileSort.open("w", "TEXT", "????");
    fileSort.lineFeed="Unix";
    fileSort.encoding = "UTF-8";
    fileSort.writeln("<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>");
    fileSort.writeln("<dirinfo>");
    fileSort.writeln("<files>");
    for(var t in fileList){
        fileSort.writeln("<item key='" +fileList[t][0].toString().replace(/&/,"&amp;") +fileList[t][1].toString() +"' />");
    fileSort.writeln("</files>");
    fileSort.writeln("</dirinfo>");
    fileSort.close();
    fileSort.hidden=true;
    app.document.chooseMenuItem("mondo/command/new");
    app.documents[0].close();
    app.document.sorts = [{ name:"user",type:"date", reverse:false }];
    function zeroPad(n, s) {
       n = n.toString();
       while (n.length < s)  n = '0' + n;
       return n;

  • Desktop oddities when trashing file or folder

    Okay, this isn't a big deal, but it disturbs my normal way of using the computer.
    When I press Command-Delete for a file or folder I've selected on the Desktop it moves it to the trash.
    However THEN the Finder selects the "next" file or folder on the Desktop?
    Why? This is stupid.
    {I upgraded from SL to ML, so maybe I missed something}

    Okay, I created a dummy account called dummy and switched to that. As clean of an account as it could be, since the fun of signing up for an iCloud account/Apple ID appeared. Still did it. Signed back into my regular account, still doing it. I do have a number of files/folders on my Desktop, but not like some crazy people, and I have an alias for the harddrive there too.What I've noticed is that the sequence almost makes sense... so, I select a file, press Command-Delete, that file moves to the trash, and another file that was the most recent one created on the desktop is the next selected. Weird, huh? I think it's just a matter of playing with the "Sort By" and "Clean Up By" options unde View, but it's still bugging me since I have to deselect a file/folder after trashing a previous one.
    Meh, still no big deal.

  • Hi,delete file from folder?

    hi,i am deleting file from folder as follwos
    <%@ page import="java.io.File" %>
    <%
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\xyz.txt");
    myFile.delete();
    %>
    i am sucessfuly deleted file from above path.
    if i use follwing code i unable to delete my file, can one help,
    how to do it,
    <%@ page import="java.io.File" %>
    <%
    String fname="xyz.txt";
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\'"+fname+"'");
    myFile.delete();
    %>
    thanks
    pullareddy

    i think if above doesn't work try this it should work
    change this line
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\'"+fname+"'");
    to this
    File myFile = new File("D:\\jakarta-tomcat-4.1.18\\webapps\\ROOT\\upload_files\\"+fname);

  • Delete file from folder only (not from list)

    Hi all,
    I've searched a lot and didn't succeed so far, that's why I need your help. In a cloud context, I'm actually creating and uploading files (pdf and/or xml files) "on the go" to sharepoint folders via the SOAP API and this is perfectly working. But
    in a cloud context, I also need to decomission services which is translated into deleting files into Sharepoint.
    That's where it became complicated, because according to the API we cannot delete files if they are not part of a list structure, which is not my case. Is that true ?
    The only info I have when trying to delete a file via the SOAP Api is : its name, its folder, and the endpoint where the folder is. So my question remains simple I guess : is this possible ? If so, how to (a link to the SOAP body would be usefull)
    Thanks a lot
    Regards
    Baptiste

    Hi,
    According to your post, my understanding is that you want to delete file from folder.
    In SharePoint 2010, It is recommended to use Client Object Model to achieve it, the following code snippet for your reference:
    string siteURL = "http://siteurl";
    ClientContext context = new ClientContext(siteURL);
    //specific user
    NetworkCredential credentials = new NetworkCredential("username", "password", "domain");
    context.Credentials = credentials;
    Web web = context.Web;
    context.Load(web);
    context.ExecuteQuery();
    string relativeUrl =web.ServerRelativeUrl +"/DocumentLibraryName/FolderName/FileName";
    File file = web.GetFileByServerRelativeUrl(relativeUrl);
    context.Load(file);
    file.DeleteObject();
    context.ExecuteQuery();
    If you still want to use SOAP API, we can use the UpdateListItems method under Lists web service to achieve it.
    http://www.dhirendrayadav.com/2010/06/delete-list-items-using-web-service.html
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/61466984-1844-48a1-8c1e-1c59a0f9876a/move-and-delete-files-remotely-using-sharepoint-web-services-?forum=sharepointdevelopmentlegacy
    Thanks,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Dennis Guo
    TechNet Community Support

  • [Solved] Error : The file or folder path /Probl?me 1 does not exist

    Hello,
    I encountered this error
    The file or folder <path>/Probl?me 2 does not exist
    while I was trying to open a directory already extracted from a zip file containing directories with special characters. In this case, it is a "è" that was misinterpreted as a "?".
    I searched the forums and on google, the solutions proposed do not work for me. Although, I have to deal with these files written in french, I would like to have my locale in english (US), with a system wide support for special characters.
    Attempt 1: Adding the option : iocharset=utf8 into the fstab, like this :
    fstab :
    # /etc/fstab: static file system information
    # <file system> <dir> <type> <options> <dump> <pass>
    none /dev/pts devpts defaults 0 0
    none /dev/shm tmpfs defaults 0 0
    /dev/cdrom /media/cd auto ro,user,noauto,unhide 0 0
    /dev/dvd /media/dvd auto ro,user,noauto,unhide 0 0
    /dev/fd0 /media/fl auto user,noauto 0 0
    /dev/disk/by-uuid/24ba75ac-e52d-40eb-a599-83b394b500b2 /boot ext2 defaults 0 2
    /dev/disk/by-uuid/c797f409-00bc-479a-b4d6-ab49943f644b / ext4 defaults 0 1
    /dev/disk/by-uuid/668427a8-5f51-42bd-a316-fc7984bf5f4f /var ext4 defaults 0 2
    /dev/sda7 swap swap defaults 0 0
    /dev/disk/by-uuid/417cd1b7-8f06-414b-84d5-e8714d9646ab /home ext4 defaults 0 2
    /dev/disk/by-uuid/ef9aa00e-0515-4d7b-aa23-8096e787250d /usr ext4 defaults 0 2
    /dev/disk/by-uuid/17d401b7-2fc7-4d9f-8e17-657d86926d2e /tmp ext4 defaults,iocharset=utf8 0 0 <<<<<<<<<<<<<<
    /dev/disk/by-uuid/71e543b6-e06c-4b0e-b1e3-3b491ff1fefe /var/cache/pacman/repos ext4 defaults 0 2
    #/dev/sda12 /mnt/archive ext4 defaults 0 2
    #.host:/ /mnt/hgfs vmhgfs defaults 0 0
    This solution does not work, because after adding iocharset=utf8, in front or after a "defaults", after a reboot, while mounting the filesystem, there is the following error message:
    Mounting Locale Filesystem :
    mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
    missing codepage or helper program, or other error
    In some cases useful info is found in syslog - try
    dmesg | tail or so
    $ dmesg | tail
    phy0: Selected rate control algorithm 'iwl-agn-rs'
    EXT4-fs (sda5): re-mounted. Opts: (null)
    EXT4-fs (sda5): re-mounted. Opts: (null)
    EXT4-fs (sda6): mounted filesystem with ordered data mode. Opts: (null)
    EXT4-fs (sda8): mounted filesystem with ordered data mode. Opts: (null)
    EXT4-fs (sda9): mounted filesystem with ordered data mode. Opts: (null)
    EXT4-fs (sda10): Unrecognized mount option "iocharset=utf8" or missing value <<<<<<<<<<<<<<
    EXT4-fs (sda11): mounted filesystem with ordered data mode. Opts: (null)
    Adding 2104476k swap on /dev/sda7. Priority:-1 extents:1 across:2104476k
    tg3 0000:07:00.0: irq 44 for MSI/MSI-X
    Attempt 2: Changing all the locale features in KDE and in /etc/rc.conf as well.
    $ vim /etc/rc.conf
    LOCALE="fr_CA.utf8"
    HARDWARECLOCK=""
    TIMEZONE="America/Montreal"
    KEYMAP="us"
    CONSOLEFONT=
    CONSOLEMAP=
    USECOLOR="yes"
    It is complicated to remove these directories. I had to use the inum to get precisely these directories before removing them.
    $ ls -il
    total 8
    1577566 drwxr-xr-x 2 [username] [username] 4096 28 jan 07:09 Probl?me 1
    1577573 drwxr-xr-x 2 [username] [username] 4096 28 jan 07:09 Probl?me 2
    $ find . -inum 1577566 -exec rm -i {} \;
    rm: impossible de supprimer « ./Probl\212me 1 »: est un dossier
    Note that the hypothetical character 'è' is represented has a '\212', a 'È' if seen as a extended ASCII character.
    These directories cannot be deleted this way :
    $ rm -r Problème\ 1
    rm: cannot remove `Problème 1': No such file or directory
    or
    $ rm -r ProblÈme\ 1
    rm: cannot remove `ProblÈme 1': No such file or directory
    What should I do to be make the operating system recognize those special character, and interpret them correctly ?
    Last edited by ramboman (2011-01-29 21:45:50)

    I found a working solution, but better solution are also welcome
    I had to have fr_CA not only in utf8 but also in iso88591. I had to modify the /etc/rc.conf this way :
    LOCALE="fr_CA" <<<<<<<<<<<<<<
    HARDWARECLOCK=""
    TIMEZONE="America/Montreal"
    KEYMAP="us"
    CONSOLEFONT=
    CONSOLEMAP=
    USECOLOR="yes"
    To preserve the english US language system wide, I had to add the following line in the /etc/profile :
    # Allow french special character while in en_US
    export LANG=en_US
    The character misinterpreted by a "?" is now seen :
    as a "è" in dolphin
    as a "?" in the console
    It is now possible to access the folders.

  • Does simple file and folder sharing on an iMac work with OSX Server?

    Hi There
    I wonder if I should install OSX Server on an iMac wher several users work on the same files and folders.
    My question - before I do something I might regret:
    Does simple file and folder sharing on an iMac within several users really work with the help of OSX Server?
    All I want to be able to do:
    Admin creates a new folder1 and gives it read- and write access for user1 and user2.
    User1 creates a subfolder1 in folder1, and a document1 in subfolder1.
    User2 edits document1. Later Admin edits document1.
    All these simple editing of files and folders (and subfolders) within a main folder should be possible. This is not possible now.
    Is everything clear? I'm not a network specialist or something, I just want to give some co-workers access to some data on my computer without problems.

    So what you need are recursive permissions.
    I suggest you create a group and add user1 and user2 to that group. You can name that group whatever you want, but for now i will call it FSUsers
    Execute this in terminal. Replace FSUsers with your new group
    sudo chmod -R +a "FSUsers allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextat tr,writeextattr,readsecurity,file_inherit,directory_inherit" /Users/Shared/*
    Replace /Users/Shared with the location of your shared folder. Make sure you keep the /* at the end (this allows all subfolders and files to get the same permissions.
    If you need to add people to the share just add them to the FSUsers group, the FSUsers group should should also be allowed in the sharing preferences.

Maybe you are looking for