Long file and path names

I have a dialog window where users can choose a file, the name and path of which is then displayed. The field where this is displayed isn't big enough to hold the typical long path names found on for example Windows. I was wondering if there is a standardized way of shortening/abbreviating the full path name already written up somewhere? I want my program to be portable ... I looked at how MS Word does it on Windows, and I could write a specialized function to copy that, but then it wouldn't work on other systems that use different path conventions, and I would like to keep the generality if possible. On word they do something like this
C:/.../final directory/filename

Kramis wrote:
sure, that much I understand, but I wouldn't know how to create that sort of string from an arbitrary path name of unknown format. In Windows, for example, I could take the first three characters and then ..., but that might not work globally. The questions is about parsing and converting a path name from an arbitrary system.I'd just split the path into its 'final directory name' and 'file name' (with the universal Java path seperator of (/)), and stick '...' in front of it.
So any path such as C:/blah/blah/blah/endpath/filename or /unix/path/blah/blah/endpath/filename would become .../endpath/filename regardless of platform.

Similar Messages

  • I want to *use* very long file and path names!

    This is really a plea to Microsoft...
    There are several threads about copying or deleting files where the path and/or file name is too long.
    Most have explanations of why this problem occurs.  (depending on Windows version and application, the total length [fully qualified file name; i.e. C:\this-dir\that-dir\somefile.xyz] is limited to a maximum of 260 or fewer characters).  This limit
    But I *WANT* to be able to use very long file names and paths!
    I can understand Microsoft keeping this limit - even while allowing UNICODE paths and file names up to 32k characters - because many existing tools will be unable to handle the longer names.  This would probably yield a lot of questions/flames about
    them "breaking the software I've used for years."
    But it would be possible to have a system setting to optionally allow the long names.  Since I'd have to manually set it, I'd know I'm potentially breaking existing software.
    In my case, I'm backing up various file directories where some files are very long.  With the server-side additional paths (e.g., client-name\project-name\backup-date\...") I occasionally hit files that can't be copied.  Renaming is not suitable;
    sometimes names have to match other file names.
    I can zip them, create iso files, use a backup program that creates a blob, put them in a source-control system, etc - but I really don't *want* to do that; it's very convenient to have a direct copy of the directories.  Each of these 'solutions' either
    requires extra work (which could be scripted, so ok...) or doesn't work with the work-flow for some reason.
    Microsoft, *please* fix this in Windows 8!  (if not before...)   This limit has existed for far too long!
    And readers - please don't just repeat what's in the other threads (rename/use subst/map directory/etc) or flame without useful information.  Thanks!

    Hi,
    I would submit your opinion to our Product Team. If you have another feedback, please feel free and let me know. Or you could follow TekDozer’s advice to submit
    by yourself.
    Thank you for your understanding and cooperation.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

  • Obnoxious file and path names (help!)

    How can I construct a regular site, that doesn't involve having my file names being danscool_website.html and having the url name in each file. I hate it.

    It would be better to tell people what it is you do want, perhaps with an example.
    If you want your file names to be different than the page and site names you yourself set in the Inspector, then you would need to edit the html by hand each time after publishing. If this is really important to you, it may be best to use another web creation app which gives you that option.
    I'm not sure what you mean by "having the url name in each file". I've seen some people inflict ugly path names on themselves by naming their site inside the iWeb app the same as their personal domain name. The fix for that is to name the site something short and simple like "1" instead.
    If you can provide your url or be more specific, more ideas may be fortcoming.

  • Automatic name changes and file and path name limitation when storing files

    Dear all I am using Airport Extrem with an attached disc and experience following:
    1) Names get changed. Second part of file name gets replaced with some hex numbering
    2) Get the error message from time to time that file can't be stored on the Airport Extrem attached disc and that the file name is too long.
    Any idea.

    I've got the same problem with seagate 750 GB drive - Mac OS Extended (Journaled) - over fast ethernet (first gen) AEBS(n)
    P.S.- sometimes the folder names get corrected automaticaly, and sometimes folders get duplicated (with different corrupted hex-like name endings) and if I delete one of them, they all vanishes.
    Message was edited by: gar_krol

  • Unicode file and path names...

    How does SleepyCat handle Unicode file names and directory paths?
    Are there any coding examples?
    Thanks

    We have support for Unicode using UTF-8 encodings.
    What platform(s) do your applications need to run on? Would Windows support for UTF-8 be sufficient?
    Related information:
    DB_ENV->open: http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/env_open.html
    DB->open: http://www.oracle.com/technology/documentation/berkeley-db/db/api_c/db_open.html
    "When using a Unicode build on Windows (the default), the db_home argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters."
    "When using a Unicode build on Windows (the default), the file argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters."
    Bogdan Coman

  • File and directory names with Danish characters

    I have installed the Novell Client v2.0 for Linux on my Open Suse 10.3. The Client is connecting to my Netware servers (6.0 & 6.5) without any problems...
    There is one problem... Filenames and directory names with the Danish , & (ae, oe & aa), e.g the filename bger.doc (bger = books) is shown as b. and when clicking the file the file disappears from the file list. It seems to be the same problem with the German (umlaub).
    What to do?
    /Michael

    Originally Posted by J.H.M. Dassen (Ray)
    mimo <[email protected]> wrote:
    > There is one problem... Filenames and directory names with the Danish ,
    > & (ae, oe & aa), e.g the filename bger.doc (bger = books) is shown as
    > b. and when clicking the file the file disappears from the file list. It
    > seems to be the same problem with the German (umlaub). What to do?
    As far as I know, the Novell Client for Linux expects that file and
    directory names use the UTF-8 encoding and does not support a traditional
    8-bit encoding like ISO 8859-1. Try changing the encoding of file and
    directory names to UTF-8 as described in
    SDB:Converting Files or File Names to UTF-8 Encoding - openSUSE
    HTH,
    Ray Dassen
    Technical Support Engineer, EMEA Services Center, Novell Technical Services
    Novell, Inc. Software for the Open Enterprise Software for the Open Enterprise
    Seems a good hint. When I create a folder or file from within SUSE using an "Umlaut" everything is OK and NCL 2.0 displays them correctly as they are UTF-8 formatted.
    The proposed tool is no solution: one cannot convert folders or files that one cannot see (does it work for folders at all?). Maybe a windows tool would work because one could search for all files or folders with "Umlaute" and convert them. Other options?

  • Prevent using special characters in file and folder names?

    I've recently begun adding windows clients to my network. In doing so, I've found that on my file shares from OS X server, the windows clients are unable to see files and folders which have names containing special characters such as / ? < > \ : * | ”
    Unfortunately my accounting department has been creating files with these characters in their names for several years. I would like to find if there is a way to prevent them from using a defined set of characters in the file and folder names to prevent them from "accidentally" doing so in the future.
    I've found that by turning off streams support on SMB in OS X server, that my windows clients can at least see that a file or folder should exist, albeit with a corrupted file name. Removing the special characters from these names allows the proper name to become visible and the file accessible.
    Any info would be greatly appreciated.

    (_seb_) wrote:
    > Gary White wrote:
    >> On Sun, 19 Nov 2006 19:15:04 +0100, "(_seb_)"
    <[email protected]> wrote:
    >>
    >>> "ça alors: it's a déjà-vu"
    >>>
    >>> How can I encode this so it's valid as a
    directory name, yet can be
    >>> displayed as intended when the name is output to
    the page.
    >>> urlencode() does not do the job, neither does
    htmlentities()...
    >>
    >>
    >> What's wrong with:
    >>
    >> $l="ça alors: it's a déjà-vu";
    >> print urlencode($l)."<br>\n";
    >> print htmlspecialchars($l);
    >>
    >> Gary
    >
    >
    > I know that, but what is the name of the directory? It
    has to be a real
    > directory name, not a string stored somewhere.
    >
    > What's a valid encoding for a directory named "ça
    alors: it's a
    > déjà-vu"? I can call a folder like this on my
    Mac, but it won't work on
    > any server...
    >
    >
    >
    PS: basically it's not a url encoding issue.
    I can url encode "ça alors: it's a déjà-vu",
    and pass it in a url query string. But my issue is not
    with an url query string, it's with an actual URL, that is,
    the actual name of the directory. It
    can't be "ça alors: it's a déjà-vu". But I
    want to allow the user to name their directory like that
    if they want. So I need a way to encode this into characters
    that can be used for an actual
    directory on the server.
    seb ( [email protected])
    http://webtrans1.com | high-end web
    design
    Downloads: Slide Show, Directory Browser, Mailing List

  • How do I turn a list of files and paths into this format using AS?

    Hi everyone,
    I'm a complete novice with Applescript and I need some help to script turning a list of files from the Finder into a specific format in a text doc, so I can save as CSV and import into another app (Anki, for learning language).
    Here's an example list of files:
    I can get Automator to spit out the files names and paths into a text file, but I think I need Applescript to turn the result into this:
    <img src="12-1.jpg">;[sound:12-1.caf];;
    <img src="12-2.jpg">;[sound:12-2.caf];;
    <img src="12-3.jpg">;[sound:12-3.caf];;
    <img src="12-4.jpg">;[sound:12-4.caf];;
    Any help would be appreciated.

    This processes the JPG files, and then assumes that the CAF files are in the flle structure you provided.
    Select files in the Image Folder:
    The Run Shell Script [pass input as arguments] is:
    for f in "$@"
    do
         caf="$f"
         caf=${caf/Images/Audio}
         caf=${caf%.*}.caf
         echo \<img src=\""$f"\"\>\;\;[sound:$caf\]\;\;
    done

  • PDF Download in Preview and Path Names

    The menu in Preview changed with the new upgrade to Lion.  When I download a PDF document and go to 'save as' in whatever folder I want, the option to save as is not listed. 
    Also, I have now go to folder and enter the path name whereas before I never had to enter a path name to find a folder.  What am I doing wrong?  Maybe I don't understand the new changes and upgrade?
    Please help.
    Moms90

    Thanks leroydouglas!  This worked for me.  Sometimes I feel so 'stupid', but am new to Mac. . .
    Moms90

  • Why are my file and folder names changing randomly? (Appending Dates)

    Recently Finder has taken to randomly (it seems) appending the date to various folder and file names. For example today I dragged a file from Destop into Documents folder and the file name changed immediately after the move:
    From: wedding-invite.pdf
    To: wedding-invite 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013 12/11/2013.pdf
    This has happed to folder names as well with different amounts of replication and different dates (usually today's date or document creation date). It happens to some files and folders but not to others. Those that it does happen to have no UNDO trail for the particular action (like Undo Move for example).
    Very frustrating - any assistance would be appreciated.
    I am running nothiong special (I do run Google Drive on my iMac). Also Time Machine.

    Thanks! I found this on the folder actions setup:

  • Dynamic File and Directory Name without Mapping

    Hello Experts,
    We have following requirement:
    1) Files will be picked from R/3 AL11 directory and would be placed in corresponding folder in target system.
    2) On source side ,there would be only one folder for all types of files(around 20),but on target side,there would be one folder for each kind of file(20 folders)
    3) File name should be same on the target side but target directory should be selected based on file name.
    I have gone through a number of posts related to similar requirements and hence,sorry for a new post but I am not yet able to find a solution to this.
    I could understand,this can be achieved using DynamicConfiguration UDF .
    But I have no possibility to have mapping in my scenario.It would just be a pass through scenario.
    Can anyone please suggest a solution to this?
    Thanks.
    Regards,
    Shweta

    Hello,
    Thanks a lot for suggesting solution to this problem.
    I could achieve this using following Java mapping:
    import com.sap.aii.mapping.api.*;
    import java.io.*;
    import java.text.*;
    import java.util.*;
    public class GetDynamicConfiguration implements StreamTransformation {
        private Map param;
        public void setParameter(Map map1) {
            this.param = map1;
        public void execute(InputStream inputstream, OutputStream outputstream) throws StreamTransformationException {
            try {
                   AbstractTrace  trace = null;
                // a) Set ouput File name
                String directory=null;
                   trace = (AbstractTrace)param.get(StreamTransformationConstants.MAPPING_TRACE );
                param.put(DynamicConfigurationKey.create("http://sap.com/xi/XI/Dynamic", StreamTransformationConstants.DYNAMIC_CONFIGURATION), "");
                DynamicConfiguration conf = (DynamicConfiguration) param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
                DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
                   DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "Directory");
                String filename =conf.get(key);
                conf.put(key, filename);
                   trace.addInfo("File name is "+filename);
                if(filename.equals("in.txt"))
                directory = "/home/ftpxi/in";
                   if(filename.equals("test.txt"))
                   directory = "/home/ftpxi/in/test";
                   if(filename.equals("shweta27.txt"))
                   directory = "/home/ftpxi/in/test";
                   trace.addInfo("Directory name is "+directory);
                   conf.put(key1, directory);
                // b) Just copy input file to output file
                byte[] b = new byte[inputstream.available()];
                inputstream.read(b);
                outputstream.write(b);
            } catch (Exception exception) {
                exception.printStackTrace();
    Thanks again.
    Regards,
    Shweta

  • Issue with recieving long SMS and Caller Name display

    Hi,
    Im new to the blackberry and  have looked around other forums & technical centre and havn't found any way to solve my issues although  i did find something about caller id problems.
    1) When people send me long SMS i.e over 160 characters long i keep recieving them in separate SMS and it becomes very confusing... i have owned over 7 different phones in the past and this has never been a problem. Is there any way to solve this?
    2) Quite often when someone calls me, i only seem to be able to see the callers number and not the Name, this is frustating as i have no idea who is ringing.
    Hope you can assist me.
    Thanks.

    It helps to give ALL the details of yoru device, such as your OS release on the device and your carrier as well.
    1.  Verizon blocks combined SMS over 160 characters on their BlackBerrys. You should fuss at them. Other carriers don't do this. An alternative for you is the application called "Beyond160", find it in AppWorld.
    2. There could be any one of three solutions... Try these:
    a. Make sure you set your own country code at Phone Dialer Screen > Options > Smart dialing.
    Set your country code in this format: "+xx" where xx = your country code. Some countries have two or three digit Country Codes. Do not place the '+' in your contact's entry.
    * In the US, set this Country Code as "+1", and place your loca area code in the proper box (this normally the default setting in a new BB).
    b. At the same location, change the National Number Length to the number of digits for your country (since some countries will have less than 10 as set as the default in the BB). Find out the total digits, minus the country code. Do not place the '+' in your contact's entry.
    * For example, some countries have a total number to 8 (plus 3 for country code). You would enter "8".
    c. You may have "Content Protection" set on your Address Book.
    Look at Options > Security > General Settings. Scroll down to Content Protection > Include Address Book = NO.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Bring back colored file and folder names

    The dots have got to go!!!  Make them an option if you need to, but GIVE US BACK THE HIGHLIGHTING OF FILE NAMES, FOLDER NAMES, AND FOLDERS!!!!!!!!
    WHEN ARE YOU GOING TO LISTEN TO YOUR CUSTOMERS --- THIS IS NOT A GOOD IDEA

    These are user-to-user forums where everyday folk (volunteers) post questions and offer answers (technical support) to each other.
    Apple involvement. Apple may respond to questions but does not formally provide technical support on the Site. Any information that is provided by Apple or Apple employees is offered on an "AS IS" basis without warranties of any kind.
    Post your concerns in the Product Feedback forum. 
    Posting in CAPS LOCK Is often seen as screaming and is not appreciated.  It's also very hard to read. 

  • Listing Files Without Path Name?

    Well this is about the only way I could figure out how to get the file names contained with in this path.
         public String[] getFileName(File path){
             File files[];
             files = path.listFiles();
             Arrays.sort(files);
             String data[] = new String[files.length];
             for (int i = 0, n = files.length; i < n; i++) {
              data[i] = files.toString();
              return data;

    public String[] getFileName(File path){
             File files[];
             files = path.listFiles();
             Arrays.sort(files);
             String data[] = new String[files.length];
             for (int i = 0, n = files.length; i < n; i++) {
              data[i] = files.getName(); // instead of toString()
              return data;
    Edited by: Metko on Mar 31, 2008 6:48 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Copy files and see names of files/folders as copying

    I am having trouble backing up data between two drives and I want to see where it is getting stuck on. Is there a simple way or tool to see the actual progress of files being copied so I can see what file it is on at the time it has trouble?

    David Shauger1 wrote:
    I am having trouble backing up data between two drives and I want to see where it is getting stuck on. Is there a simple way or tool to see the actual progress of files being copied so I can see what file it is on at the time it has trouble?
    don't know any such tool but check your Console log. it will likely say what it's choking on.

Maybe you are looking for

  • Remote App No Longer Working

    I am tearing my hair out trying to figure this out. For whatever reason, the Remote app has completely stopped working. I am using OS X. I have deleted and reinstalled the Remote App. I have deleted and reinstalled Itunes. When I go to "Add Library"

  • HT2534 The none button is not exist? So what is the problem?

    Iv tried so many times to review my payment info in order for me to download free apps in the store... but seems like the 'none' button is not exist... what did i missd?

  • Mount options for ZFS filesystem on Solaris 10

    Do you know some recomendation about mount options for SAP on Oracle with data on ZFS filesystem? Also recomended block size required. We assume that file system with datafiles has 8kb block size and offline redologs has default (128kB). But what abo

  • Mouse responding slowly in a cool room?

    I recently did a warehouse party using my Macbookpro 15 to run Traktor Scratch Pro 2 DJ software. It was NOT extremely cold (maybe 10c). When I set up and was playing my MBP ran fine but my mouse was extremely slow and unresponsive. What could it be?

  • Looping part of a song

    Hi guys, All new to Garageband with a recent purchase of a schmick new iMac, should of moved to mac a long time ago! I am wanting to know how I can loop part of a song? For example, I have a song that has a cool intro and I want to extend only that p