File names in Windows NT and UNIX

I have an application I made using Java 1.1.8 for AIX 4.2.1 ( IBMs UNIX). I develope on Windows NT using JDeveloper ( from Oracle). My problem is that I need to access files in my code. My code will run both on Windows and Unix, but the file directories are different. How can I access the same NAME of a file , which is in different directories on different Platforms. On the NT machine the file would be
c:\\temp\someFile.txt, but on my Unix machine it would be /users/xxx/test/someFile.txt.
Are there any ENVIRONMENTAL variables I can use?

Look at the documentation for system properties: [url http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperties()]http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperties()
You may be interested in user.home, user.dir, java.io.tmpdir

Similar Messages

  • How to copy the photo with file name at window 7 and search specific one in iphone 4s?

    How to copy the photo with file name at window 7 and search specific one in iphone 4s?

    Clendenen02 wrote:
    2) It would be equally helpful if there was something that would take the name of the picture file and spotlight comment, copy and paste it to a movie file's comments with the same name but obviously has different extention. For an example
    In a Pictures folder
    Name: Dark Knight, The.jpeg       Comment: (2008) Genre: Action...             <- copy comment
    In a Movie Folder
    Name: Dark Knight, The.m4v       Comment:                                               <- paste 
    and do this for all 700 files
    This Bash script will do it.
    Edit "PicDir" and "MovDir" to the location of your Folders
    (Note: The comment is written to the m4v file using xattr, so the Spotlight comment field appears blank in Finder, but the comment metadata is still indexed by Spotlight (If you add a Spotlight comment from Finder, it is stored both as an extended attribute and in a .DS_Store file)
    #!/bin/bash
    PicDir=$HOME/Desktop/Pictures
    MovDir=$HOME/Desktop/Movies
    for f in $PicDir/*
    do
         if [ ! -d "$f" -a "${f##*.}" == "jpeg" ]; then
              comment=$(mdls -raw -name kMDItemFinderComment "$f")
              if [[ $comment != "(null)" ]]; then
                   picname=${f##*/}
                   movname=${picname%.*}.m4v
                   if [ -e "$MovDir"/$movname ]; then
                         xattr -w com.apple.metadata:kMDItemFinderComment "\"$comment\"" "$MovDir"/$movname
                   fi
              fi
         fi
    done

  • IDOC to File Port on Windows Server from Unix SAP System

    Hi All:
    I want to use an IDOC to create a text file on a Windows server. The SAP system runs on Unix. I have no problem creating the text file on the same Unix server running the SAP instance but I can not figure out how to write the file to a share or UNC path on a Windows server. I tried to create a logical file path using transaction FILE and then create a logical port in WE21. The IDOC failed because it is still looking on the Unix server to write the file. Any ideas from the community would be greatly appreciated.

    Hmmm, there are probably lots of ways to skin this cat.
    To make the process asynchronous you probably want to be along the lines of either updating a table or placing a file on the Windows machine, and then having a database process or Windows program to watch for the file or database table entry and triggering your bat file when it appears.

  • I can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name

    can not transfer date from one hard drive to another, I keep getting an error because I have two of the same file names and one file name is in caps and I cant change the file name. My original external has an error and needs to be reformatted but I dont want to lose this informations its my entire Itunes library.

    Sounds like the source drive is formatted as case sensitive and the destination drive is not. The preferred format for OS X is case insensitive unless there is a compelling reason to go case sensitive.
    Why can't you change the filename? Is it because the source drive is having problems?  If so is this happening with only one or two or a few files? If so the best thing would be to copy those over individually and then rename them on the destination drive.
    If it is more then you can do manually and you can't change the name on the source you will have to reformat the destination as case sensitive.
    Btw this group is for discussion of the Support Communities itself, you;d do better posting to Lion group. I'll see if a host will move it.

  • How I can saving visa resource name in windows registery and load it again?

    I use visa functions in my program for serial communication , I want to save selected resource name in windows registery and next time that i run my program, i want to read it from registery and assign it to my visa resource name control.
    example:         My visa resource name control value = COM2
                            I close my program with this value (how i can easily save COM2 to windows registry key ?)
                            I open my program again (how i can load COM2 in my resource name control from registry Key?)
                            How i can access to visa resource name list? example: COM1     COM2      LPT1     COM56     COM255
    Thanks.
    Solved!
    Go to Solution.

    I guess I don't understand your problem. All you have to do is ready the key containing the desired resource name and wire the resulting value to the appropriate terminal on the open VI. That's as hard as it gets...
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to insert the file name to the start and the end of a SQL file by a powershell script

    I just began to learn powershell script and I have a problem that I cannot figure out. I have a lot of .sql files. I need to insert its file name to the beginning of the file (After USE statement) and the end of the file (before the last END statement). Is
    there anybody knowing how to do this?
    Thanks so much
    Regards

    Actually, I want to add a insert SQL statement to the beginning of the file and the end of the file. Only the file name is a variable and different among
    different files. All the other sql statements are the same and can be hard coded. Hopefully it helps –
    The problem I think is that I want to add the same thing (except the file name) to hundreds of sql files and only the file name is different. I do not want
    to add it manually and want to use a script to add it – 

  • What are shortest file names for outlook express and PSE11 to import photos pls

    what are shortest file names for outlook express and PSE11 to import photos pls

    Hi, Troubled. The size of the file name is pretty much irrelevant here to PSE, but to answer your question directly, you will be able to import a file that has only a single character as its file name (plus the file name needs to have the required extension, such as .jpg)

  • File Sharing between Windows PC and MacBook Pro using Internet Sharing

    I have a MacBook Pro and a Dell Latitude D820 running Windows XP SP2 and I want to connect both using any of these two options. I do not have a wireless router and I use Sprint 3G data card to access internet.
    1) I access the internet using a EVDO data card on my MAC and use Internet sharing to access the internet on my Dell laptop. How do I access the files on my PC from my MAC?
    2) I can have two EVDO data cards to access the MAC and PC independently. How can I setup file sharing between Windows laptop and MAC?

    Hi Dr. Poultry-
    This may be helpful: Mac OS: Connecting to the Internet and sharing files locally at the same time
    Luck-
    -DaddyPaycheck

  • User Logon Name (pre-Windows 2000) and Domain Name Don't have the same Value

    Hi
    is it possible to have User Logon Name (pre-Windows 2000) and Domain Name with different value?
    Exemple:
    domain name domain1.com
    and User Logon Name (pre-Windows 2000) Domain2\user

    If you have trust in place, then also you can use trusted domain name to login from trustee domain. Also, UPN suffix can be added.
    http://technet.microsoft.com/en-us/library/cc773178%28v=ws.10%29.aspx
    Awinish Vishwakarma - MVP
    My Blog: awinish.wordpress.com
    Disclaimer This posting is provided AS-IS with no warranties/guarantees and confers no rights.

  • Anyone know the syntax for printing-to-file for the file name in windows? Tried the following and it did not work...C:\Documents and Settings\Cal\My Documents\FolderForPrinting but I also put it in small quotes.

    Two issues I think.
    One is how a file is specified to print to.
    Second is how directories with spaces are allowed, and the detail for allowing spaces in directory or file names.
    This is an XP operating system from Windows.
    Firefox is the browser.

    Two issues I think.
    One is how a file is specified to print to.
    Second is how directories with spaces are allowed, and the detail for allowing spaces in directory or file names.
    This is an XP operating system from Windows.
    Firefox is the browser.

  • File name conversions Windows Mac OS X

    Hello!
    I have just switch from Windows XP to Mac OS X. In fact, I did it two days ago, and I feel I am still mostly lost. I wonder if you can help with a newbie/switcher question:
    I have moved all my files to the Mac, but I have notice that, though the file names are correct, the name of those files that were inside a ZIP show strange characters, and it is so for the non-English characters like áéíóúàèìòùñ etc.
    I have noticed the same inside my txt files. Also, some punctuation marks do not show properly.
    What is the explanation for this? Can it be solved? How could I do it?
    Thank you all beforehand.

    This is interesting, I believe I found what is an ASCII->Unicode file converter for OSX. It is a command-line tool, so you would need to know how to use terminal.
    Go to this page and take a look:
    http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=TECkitDownloads
    The installer is:
    TECkit version 2.2.1 for Mac OS X
    Jonathan Kew, 2006-09-19
    Download "TECkitinstaller2.2.1.tar.gz
    I downloaded it and installed it, the command to launch it is:
    /usr/local/bin/txtconv
    which returns an instruction page. This looks like a document converter, not a filename converter.
    I don't have any non-english files here so I can't test it, but maybe someone who knows more about command tools can help you more, like the UNIX forum on these boards.
    PS:
    I did tun the command on a test file like this:
    /usr/local/bin/txtconv -i ~/testIN.txt -o ~/testOUT.txt
    and it did create a new output file but no translated characters. If you would send a few files to my email address I'll mess with it for you.
    See my profile for that address.

  • How do I change file names in "Windows Friendly" attachments before sending?

    In sending some "Windows Friendly" attached images, I want to change the file names so they are meaningful to the recipient. (I don't want to change the file name in my picture catalog, just for this mailing.)  In Outlook on an old pc, I remember being able to right click and rename the file in the email draft. I've tried right clicking on the image (which looks embedded in my draft), but there is no option for renaming. I can't see the file name in my draft to figure out another way to change it. I'm sure other people want to do this when sending other types of files, so there must be a way, right? I'm using the current version of Mail.
    Thanks!

    I'm pleased to have helped, if you are mailing images all the time perhaps you could create a new folder on the Desktop or in Finder/Username store your images in the folder rename the images click Drag & Drop more than one at a time but don't make the package too big!

  • Mac corrupts file names on Windows network

    I am using my MacBook with Tiger on a Windows peer-to-peer network. Works fine, except occasionally files names that I access on one of the Windows machines will become confused. It's occurrence seems random to me; I think it only happens when I save changes, though. So, for instance, the file OnlineAccountInformation.xls would become OnlineAcco%32hg.xls. Any idea what might be causing this? I had the same problem with Panther.

    well ther eis a 32 char limit for a file name .and an 80-something limit for the total path i think. Usually though i get an error message that just says so much or simply that an erro occured and the file couldnt be saved. Also if you have a super long name that youve saved on the windows machine youll usually get the DOS name of the file when browsing from a mac.

  • Parsing a File Name into A Timestamp and Applying it as Metadata

    Hello,<br /><br />I am working on a lo-fi photographic documentation project, and the camera I am using does not record EXIF information. The extent of the metadata it provides is in the naming convention which is in the format of "DD-MM-YY_HHMM.jpg". What I am trying to do is create a script to take a selection of images and parse the filename into a timestamp to apply it into the IPTC and EXIF properties and also add in the EXIF Make, Model, et al.<br /><br />The following code I am in the process of working on but have hit a block. After the line: "var md = file.metadata;" nothing seems to happen. I have placed an arbitrary "Window.alert("Hi")" in just to see if it would get executed and it did not. Can anyone explain why this is and why I get no error response if something is in fact wrong?<br /><br />     #target "bridge" <br />     <br />     normalize = new MenuElement( "command", "Normalize Motorola v220 Images", "at the end of Tools");<br /><br />     normalize.onSelect = function() {<br />     <br />          // Get The Selected Images<br />          var images = app.document.selections;<br /><br />          for (i=0; i<images.length; i++) {<br />          <br />               // Declare File Variable<br />               var file = images[i];<br />               <br />               if (images[i].mimeType == "image/jpeg") {<br />                    // Parse filename into date<br />                    var fn = file.name;<br />                    var timestamp = "20"+fn.substr(6,2)+"-"+fn.substr(3,2)+"-"+fn.substr(0,2)+"T"+fn.substr(9,2)+":"+fn.subst r(11,2)+":00";<br /><br />                    // Get Metadata<br />                    var md = file.metadata;<br />                    <br />                    // Apply Date to EXIF Metadata<br />                    md.namespace = "http://ns.adobe.com/exif/1.0/";<br />                    md.DateTime = timestamp;<br />                    md.DateTimeOriginal = timestamp;<br />                    md.DateTimeDigitized = timestamp;<br />                    <br />                    // Apply Date to IPTC Core<br />                    md.namespace = "http://ns.adobe.com/photoshop/1.0/";<br />                    md.DateCreated = timestamp.substr(0,10);<br />          <br />                    // Apply Motorola v220 Related Metadata<br />                    md.namespace = "http://ns.adobe.com/tiff/1.0/";<br />                    md.Make = "Motorola";<br />                    md.Model = "Motorola v220";<br />                                        <br />                    // Apply User Specific Data<br />          <br />                    // Rename file<br />                                   <br />               } else {<br />                    <br />                    // Give an Alert that the Image isn't a JPEG<br />                    Window.alert(file.name+" isn't a JPEG");<br />                    <br />               };<br />               <br />               file.refresh();<br />          <br />          };<br />     };<br /><br />I would also like to rename the files to the timestamp sans the colons but that will come after.<br /><br />Help.

    That didnt seem to work, the same full filename (minus the extension) still prints.  Here is more of the script. I tried to attach the whole thing but it wouldnt upload.
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.PERCENT;
    try
    var docRef = activeDocument;
    // Create a text layer at the front
    var myLayerRef = docRef.artLayers.add();
    myLayerRef.kind = LayerKind.TEXT;
    myLayerRef.name = "Filename";
    var myTextRef = myLayerRef.textItem;
    //Set your parameters below this line
    //If you wish to show the file extension, change the n to y in the line below, if not use n.
    var ShowExtension = "n";
    // Insert any text to appear before the filename, such as your name and copyright info between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextBefore = "";
    // Insert any text to appear after the filename between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextAfter = "";
    // Set font size in Points
    myTextRef.size = 24;
    //Set font - use GetFontName.js to get exact name
    //myTextRef.font = "TimesNewRomanPSMT";
    myTextRef.font = "Arial";
    //Set text colour in RGB values
    var newColor = new SolidColor();
    newColor.rgb.red = 255;
    newColor.rgb.green = 255;
    newColor.rgb.blue = 255;
    myTextRef.color = newColor;
    // Set the position of the text - percentages from left first, then from top.
    myTextRef.position = new Array( 2 , 99);
    // Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
    myLayerRef.blendMode = BlendMode.NORMAL;
    // select opacity in percentage
    myLayerRef.opacity = 100;
    // The following code strips the extension and writes tha text layer. fname = file name only
    di=(docRef.name).indexOf(".");
    fname = (docRef.name).substr(0, di);
    //use extension if set
    if ( ShowExtension == "y" )
    I really appreciate the help.

  • How to get the incoming file name using JMS adapter and SOAP adapter

    Hi Everybody,
       In one of my interface i need to get the file name of incoming flat file using JMS adapter at sender side. and then i am using xslt to convert it to IDOC and then posting to  SAP IDOC.
    my incoming filname are in this form price<DateTimestamp>.txt. when i do the tranformation this incoming file name should be part of one element in the IDOC which i am posting.
    EX:
    <IDOC
    <REF>price<DateTimestamp>.txt</REF>
    </IDOC>
    Hope it is clear to everybody. I need your suggestion how i can capture this incoming file name and send it as part of IDOC.
    Thanks
    raj

    If they are passing it in message id or correlation id,
    you can access it using
    <xsl:variable name="dynamic-conf" 
            select="map:get($inputparam, 'DynamicConfiguration')" />
        <xsl:variable name="dynamic-key"  
            select="key:create('http://sap.com/xi/XI/System/JMS', 'DCJMSMessageID/ DCJMSCorrelationID')" />
        <xsl:variable name="dynamic-value"
            select="dyn:get($dynamic-conf, $dynamic-key)" />
    Check this:
    http://help.sap.com/saphelp_nw70/helpdata/en/f4/2d6189f0e27a4894ad517961762db7/content.htm
    Thanks,
    Beena.

Maybe you are looking for