f



Obtain file path and file name using file chooser

Hi All,
I want to obtain both file  "path" and the filenamed  MyText.txt ....as
in "C:\Documents
and Settings\bH\Desktop\MyShowWithFrame\MyText.txt"

I have tried to discover the options shown in How to Use File Choosers
(The Java=E2=84=A2 Tutorials  Creating a GUI with JFC-Swing Using Swing
Components).htm

I cannot understand what options should be shown as but this does not
work.

Program snip:
     JButton opnButton =3D new JButton("Open a Text File...");
     buttonPanel.add(opnButton);
     opnButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        int returnVal =3D fc.showOpenDialog(FileChooserDemo.this);
        fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
        if (returnVal =3D=3D JFileChooser.APPROVE_OPTION) {
           File file =3D fc.getSelectedFile ();
            strngFileName =3D  file.getName();
        }
      }
    });

        });

TIA=20
bH

0
bherbst65 (267)
11/28/2006 3:53:25 AM
comp.lang.java.help 13340 articles. 0 followers. Post Follow

6 Replies
1247 Views

Similar Articles

[PageSpeed] 27

bH wrote:
> Hi All,
> I want to obtain both file  "path" and the filenamed  MyText.txt ....as
> in "C:\Documents
> and Settings\bH\Desktop\MyShowWithFrame\MyText.txt"
>
> I have tried to discover the options shown in How to Use File Choosers
> (The Java=E2=84=A2 Tutorials  Creating a GUI with JFC-Swing Using Swing
> Components).htm
>
> I cannot understand what options should be shown as but this does not
> work.

Is it lazy?  Or to put that another way 'it doesn't work'
tells us very little.  Please describe in detail, what you
see on-screen, what happened off-screen (with debug
statements and such) and what you expected to happen.

However - taking a wild stab..

> Program snip:
>      JButton opnButton =3D new JButton("Open a Text File...");
>      buttonPanel.add(opnButton);
>      opnButton.addActionListener(new ActionListener() {
>       public void actionPerformed(ActionEvent e) {
>         int returnVal =3D fc.showOpenDialog(FileChooserDemo.this);
>         fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
>         if (returnVal =3D=3D JFileChooser.APPROVE_OPTION) {
>            File file =3D fc.getSelectedFile ();
>             strngFileName =3D  file.getName();

..=2Eif I guess correctly, you might try something like

  strngFileName =3D  file.getPath() +
    System.getProperty("file.separator") +
    file.getName();

Having said that, it seems strange you are dealing with
String's, when you have a File object (which is an object
that is already one step closer to getting an input/output
stream, than a String that represents a File).

Andrew T.

0
andrewthommo (3108)
11/28/2006 4:40:48 AM
Andrew Thompson wrote:
> bH wrote:
> > Hi All,
> > I want to obtain both file  "path" and the filenamed  MyText.txt ....as
> > in "C:\Documents
> > and Settings\bH\Desktop\MyShowWithFrame\MyText.txt"
> >
> > I have tried to discover the options shown in How to Use File Choosers
> > (The Java=E2=84=A2 Tutorials  Creating a GUI with JFC-Swing Using Swing
> > Components).htm
> >
> > I cannot understand what options should be shown as but this does not
> > work.
>
> Is it lazy?  Or to put that another way 'it doesn't work'
> tells us very little.  Please describe in detail, what you
> see on-screen, what happened off-screen (with debug
> statements and such) and what you expected to happen.
>
> However - taking a wild stab..
>
> > Program snip:
> >      JButton opnButton =3D new JButton("Open a Text File...");
> >      buttonPanel.add(opnButton);
> >      opnButton.addActionListener(new ActionListener() {
> >       public void actionPerformed(ActionEvent e) {
> >         int returnVal =3D fc.showOpenDialog(FileChooserDemo.this);
> >         fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
> >         if (returnVal =3D=3D JFileChooser.APPROVE_OPTION) {
> >            File file =3D fc.getSelectedFile ();
> >             strngFileName =3D  file.getName();
>
> ..if I guess correctly, you might try something like
>
>   strngFileName =3D  file.getPath() +
>     System.getProperty("file.separator") +
>     file.getName();
>
> Having said that, it seems strange you are dealing with
> String's, when you have a File object (which is an object
> that is already one step closer to getting an input/output
> stream, than a String that represents a File).
>
> Andrew T.

Hi Andrew,
Your guess was correct and your advice helpful. Now I am in another
difficulty.

Because I am connecting with a printer after locating a file address
when I am  using the file chooser, all the file separators are "\" but
should be "/". I have tested a method: one that looks at the individual
char in the line but have not been able to represent the "\" because it
is an escape character.

A sample of the output from the chooser:
 "C:\Documents and Settings\bH\Desktop\MyPrinter
WithFrame\MyText.txt\MyText.txt"
Needs to be:
 "C:/Documents and Settings/bH\Desktop/MyPrinter
WithFrame/MyText.txt/MyText.txt"

TIA.
bH

0
bherbst65 (267)
11/28/2006 7:55:56 PM
In article <1164743756.733743.114700@l39g2000cwd.googlegroups.com>,
 "bH" <bherbst65@hotmail.com> wrote:

> Andrew Thompson wrote:
> > bH wrote:
> > > Hi All,
> > > I want to obtain both file  "path" and the filenamed  MyText.txt ....as
> > > in "C:\Documents
> > > and Settings\bH\Desktop\MyShowWithFrame\MyText.txt"
> > >
> > > I have tried to discover the options shown in How to Use File Choosers
> > > (The Java� Tutorials  Creating a GUI with JFC-Swing Using Swing
> > > Components).htm
> > >
> > > I cannot understand what options should be shown as but this does not
> > > work.
> >
> > Is it lazy?  Or to put that another way 'it doesn't work'
> > tells us very little.  Please describe in detail, what you
> > see on-screen, what happened off-screen (with debug
> > statements and such) and what you expected to happen.
> >
> > However - taking a wild stab..
> >
> > > Program snip:
> > >      JButton opnButton = new JButton("Open a Text File...");
> > >      buttonPanel.add(opnButton);
> > >      opnButton.addActionListener(new ActionListener() {
> > >       public void actionPerformed(ActionEvent e) {
> > >         int returnVal = fc.showOpenDialog(FileChooserDemo.this);
> > >         fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
> > >         if (returnVal == JFileChooser.APPROVE_OPTION) {
> > >            File file = fc.getSelectedFile ();
> > >             strngFileName =  file.getName();
> >
> > ..if I guess correctly, you might try something like
> >
> >   strngFileName =  file.getPath() +
> >     System.getProperty("file.separator") +
> >     file.getName();
> >
> > Having said that, it seems strange you are dealing with
> > String's, when you have a File object (which is an object
> > that is already one step closer to getting an input/output
> > stream, than a String that represents a File).
> >
> > Andrew T.
> 
> Hi Andrew,
> Your guess was correct and your advice helpful. Now I am in another
> difficulty.
> 
> Because I am connecting with a printer after locating a file address
> when I am  using the file chooser, all the file separators are "\" but
> should be "/". I have tested a method: one that looks at the individual
> char in the line but have not been able to represent the "\" because it
> is an escape character.
> 
> A sample of the output from the chooser:
>  "C:\Documents and Settings\bH\Desktop\MyPrinter
> WithFrame\MyText.txt\MyText.txt"
> Needs to be:
>  "C:/Documents and Settings/bH\Desktop/MyPrinter
> WithFrame/MyText.txt/MyText.txt"
> 
> TIA.
> bH

It's not clear what "connecting with a printer" has to do with anything.  
Printing in Java doesn't involve files.  It involves the Printable and 
Pageable interfaces and sending a "picture" to the printer via 
appropriate APIs.

But if you're seeking a way to refer to a File object after it's been 
selected using a JFileChooser, you should look into the java.io.File API 
a bit more closely.  It includes a couple of possible useful methods, 
which are toURL and toURI.  You might be better off using the latter.  
And doing so will result in a URI that encodes any spaces or other 
"special" characters, as well as using "real" slashes instead of those 
horrid backslash things Microsoft hoisted upon you.

= Steve =
-- 
Steve W. Jackson
Montgomery, Alabama
0
11/28/2006 9:29:59 PM
bH wrote:
> Andrew Thompson wrote:
> > bH wrote:

> > > I want to obtain both file  "path" and the filenamed  MyText.txt ....as
> > > in "C:\Documents
> > > and Settings\bH\Desktop\MyShowWithFrame\MyText.txt"
> > >
....
> > > Program snip:
....
> > >         int returnVal = fc.showOpenDialog(FileChooserDemo.this);
> > >         fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
> > >         if (returnVal == JFileChooser.APPROVE_OPTION) {
> > >            File file = fc.getSelectedFile ();
> > >             strngFileName =  file.getName();
....
> >   strngFileName =  file.getPath() +
> >     System.getProperty("file.separator") +
> >     file.getName();
...
> Because I am connecting with a printer after locating a file address
> when I am  using the file chooser, all the file separators are "\" but
> should be "/".

Aaaah.. my original answer was ..incomplete.

I was prodding you in the direction (I thought) this
code needs to go, but since we've already arrived 'there',
let's take it a bit further.

1) For starters, the way I constructed that file was
sloppy and inefficient.  The *best* way to create a File
in a given directory is to use the File contstructor to
create a File based on ..
  new File(File parent, File theFile)
...to automatically get the correct separator.

2) I cannot see why the code needs to be manipulating the
String name of the File(s) at all.  Don't the later methods
accept files as parameters?  If that is the case, you can
simply hand the later methods 'the file', and be done with it.

3) If the String name of the File *is* actually of interest, I
am pretty sure that File has some methods to produce
the entire path and filename.  Check the API..

Andrew T.

0
andrewthommo (3108)
11/28/2006 9:36:06 PM
Andrew Thompson wrote:
> bH wrote:
> > Andrew Thompson wrote:
> > > bH wrote:
>
> > > > I want to obtain both file  "path" and the filenamed  MyText.txt ....as
> > > > in "C:\Documents
> > > > and Settings\bH\Desktop\MyShowWithFrame\MyText.txt"
> > > >
> ...
> > > > Program snip:
> ...
> > > >         int returnVal = fc.showOpenDialog(FileChooserDemo.this);
> > > >         fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
> > > >         if (returnVal == JFileChooser.APPROVE_OPTION) {
> > > >            File file = fc.getSelectedFile ();
> > > >             strngFileName =  file.getName();
> ...
> > >   strngFileName =  file.getPath() +
> > >     System.getProperty("file.separator") +
> > >     file.getName();
> ..
> > Because I am connecting with a printer after locating a file address
> > when I am  using the file chooser, all the file separators are "\" but
> > should be "/".
>
> Aaaah.. my original answer was ..incomplete.
>
> I was prodding you in the direction (I thought) this
> code needs to go, but since we've already arrived 'there',
> let's take it a bit further.
>
> 1) For starters, the way I constructed that file was
> sloppy and inefficient.  The *best* way to create a File
> in a given directory is to use the File contstructor to
> create a File based on ..
>   new File(File parent, File theFile)
> ..to automatically get the correct separator.
>
> 2) I cannot see why the code needs to be manipulating the
> String name of the File(s) at all.  Don't the later methods
> accept files as parameters?  If that is the case, you can
> simply hand the later methods 'the file', and be done with it.
>
> 3) If the String name of the File *is* actually of interest, I
> am pretty sure that File has some methods to produce
> the entire path and filename.  Check the API..
>
> Andrew T.


/* Tested  using Win2k with NT, with Java jdk1.5.0_05 and a Canon
Printer.
 * This program will print "m.txt", "t.java", "ms.html" source code as
long as  the
 *  files are in the same folder as this program OR if the path and
name is shown.
 *
 * The printer output  starts at the very top of the page, full to the
very bottom
 * of the page, full left and right. However, indents are shown.
 * Then  similarily on to the second page if needed.  Printing stops on
the page
 * at  where ever the stream stops.  To get the paper out of the
printer:
 * press right button on the Canon Printer.
 */

import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.UIManager;
import javax.print.*;
import javax.print.attribute.*;
import javax.print.attribute.standard.*;
import javax.print.event.*;

public class UseFileChooser_TxtPrint extends JFrame  {
  JButton buttnOne, buttnTwo;
  String  strFileName= "";

  public static void main(String[] args) {
    UseFileChooser_TxtPrint  UseFileChooser_TxtPrint1 = new
UseFileChooser_TxtPrint();
  }

  public UseFileChooser_TxtPrint() {
    super("Print Text . . .");

    final JFileChooser fc = new JFileChooser();

    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JPanel dataPnl = new JPanel();
    JPanel btnPnl = new JPanel();
    JLabel lbleFileName = new JLabel("Start With Chooser  Button Then
Printer Button  >>> ");
    buttnOne = new JButton("Chooser Button");
    buttnTwo = new JButton("Print Button");

    dataPnl .setLayout(new  GridLayout(2, 2));
    dataPnl .add(lbleFileName);

    btnPnl.add( buttnOne);
    btnPnl.add( buttnTwo);

    this.getContentPane().add(dataPnl, BorderLayout.NORTH);
    this.getContentPane().add(btnPnl, BorderLayout.SOUTH);
    setSize(400, 100);
    setVisible(true);
    buttnOne.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        if (e.getSource() == buttnOne) {
          int returnVal = fc.showOpenDialog(UseFileChooser_TxtPrint
..this);
          File file = fc.getSelectedFile();
          strFileName = file.getPath();
        }
      }
    });
    buttnTwo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent h) {
        if (h.getSource() == buttnTwo) {
          System.out.println("Now Printing File " + strFileName);
          try {
            InputStream is = new BufferedInputStream(
                                                     new
FileInputStream(strFileName));
            // Find the default service
            DocFlavor flavor =DocFlavor.INPUT_STREAM.AUTOSENSE;

            PrintService service =
PrintServiceLookup.lookupDefaultPrintService();

            // Create the print job
            DocPrintJob job = service.createPrintJob();
            Doc doc = new SimpleDoc(is, flavor, null);

            // Monitor print job events for use for the implementation
of PrintJobWatcher,

            PrintJobWatcher pjDone = new PrintJobWatcher(job);

            // Print it
            job.print(doc, null);

            // Wait for the print job to be done
            pjDone.waitForDone();

            // It is now safe to close the input stream
            is.close();
          } catch (PrintException e) {
          } catch (IOException e) {
          }
          System.out.println("Task Completed" );
        }
      }
    } );
  }
  class PrintJobWatcher {
    // true iff it is safe to close the print job's input stream
    boolean done = false;

    PrintJobWatcher(DocPrintJob job) {
      // Add a listener to the print job
      job.addPrintJobListener(new PrintJobAdapter() {
        public void printJobCanceled(PrintJobEvent pje) {
          allDone();
        }
        public void printJobCompleted(PrintJobEvent pje) {
          allDone();
        }
        public void printJobFailed(PrintJobEvent pje) {
          allDone();
        }
        public void printJobNoMoreEvents(PrintJobEvent pje) {
          allDone();
        }
        void allDone() {
          synchronized (PrintJobWatcher.this) {
            done = true;
            PrintJobWatcher.this.notify();
          }
        }
      });
    }
    public synchronized void waitForDone() {
      try {
        while (!done) {
          wait();
        }
      } catch (InterruptedException e) {
      }
    } 
  }
}

0
bherbst65 (267)
12/1/2006 1:48:44 PM
Andrew Thompson wrote:
> bH wrote:
> > Andrew Thompson wrote:
> > > bH wrote:
>
> > > > I want to obtain both file  "path" and the filenamed  MyText.txt ....as
> > > > in "C:\Documents
> > > > and Settings\bH\Desktop\MyShowWithFrame\MyText.txt"
> > > >
> ...
> > > > Program snip:
> ...
> > > >         int returnVal = fc.showOpenDialog(FileChooserDemo.this);
> > > >         fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
> > > >         if (returnVal == JFileChooser.APPROVE_OPTION) {
> > > >            File file = fc.getSelectedFile ();
> > > >             strngFileName =  file.getName();
> ...
> > >   strngFileName =  file.getPath() +
> > >     System.getProperty("file.separator") +
> > >     file.getName();
> ..
> > Because I am connecting with a printer after locating a file address
> > when I am  using the file chooser, all the file separators are "\" but
> > should be "/".
>
> Aaaah.. my original answer was ..incomplete.
>
> I was prodding you in the direction (I thought) this
> code needs to go, but since we've already arrived 'there',
> let's take it a bit further.
>
> 1) For starters, the way I constructed that file was
> sloppy and inefficient.  The *best* way to create a File
> in a given directory is to use the File contstructor to
> create a File based on ..
>   new File(File parent, File theFile)
> ..to automatically get the correct separator.
>
> 2) I cannot see why the code needs to be manipulating the
> String name of the File(s) at all.  Don't the later methods
> accept files as parameters?  If that is the case, you can
> simply hand the later methods 'the file', and be done with it.
>
> 3) If the String name of the File *is* actually of interest, I
> am pretty sure that File has some methods to produce
> the entire path and filename.  Check the API..
>
> Andrew T.

Hi All,
Thanks for your help. Your suggestions have been most helpful.
I have revised a earlier program which is a JTextField input now to be
a chooser input.

bH

0
bherbst65 (267)
12/1/2006 1:50:49 PM
Reply:

Similar Artilces:

Bash: strip file path and file extension from a file name in a $string?
It appears that Bash supports stripping a match of $substring from $string from the front and from the back of $string through the following commands: ${string#substring} ${string%substring} Yet, it doesn't appear that it is possible to simultaneously strip a couple of substrings from the front and from the back of a string, which is a bit of a problem if a user intends to strip the path and file extension from a file listing. Nonetheless, this is certainly possible. So, is it possible to strip both the path and the file extension from a file? If so, can anyone prov...

How to copy a file to a file with a prefixed file name
I'm trying to write a program that will archive selected files to an archive directory. The files in the archive directory will have a prefix in the format yyyymmdd-hhmmss-filename.ext. So, if the file is called "somefile.dat", then the filename in the archive directory should be "20090522-164325-somefile.dat". I'm using Clipper's COPY FILE command to do the copy. I can't figure out how to get the prefix in front of the file name. Creating the prefix string is no problem, but I can't figure out how to tack that onto the front of the filename. If I...

file.exe file generation from file.m file
How to generate application (*.exe) file from *.m file, which has lots of graphics. Program was written for image watermarking by using image processing toolbox. I want to send this program some where else but with out sowing the program codes. By this *.exe no need to use matlab6.5 platform. Also tell me How to generate *.p file from *.m file Which is hide the code to user but for run this program need matlab6.5 Please give me some idea about it. it is very urgent for me. I will be very great full to you "Biswajit Kar" <hibiswajitkar@rediffmail.com> wrote in message ne...

How to get the file name from a String containing the path plus the file name?
Hi, I have a String "dirA/dirB/dirC/file.txt". How to use String manipulation technique to get "file.txt"? String fullName = "dirA/dirB/dirC/file.txt"; int index = fullName.lastIndexOf("\\"); //here is a problem, if I try lastIndexOf("\"), there is a compile error String fileName = fullName.subString(index); //but does not work Thank you very much. ps: I am working on linux. www wrote: > Hi, > > I have a String "dirA/dirB/dirC/file.txt". How to use String > manipulation technique to get "...

file extention from file file location
Hi, I am new to perl (only working on this one problem) but I program in other languages. We have an upload script written in cgi. Can anyone tell me how to get the file extension from the variable $File1 (actual file location on uploader's computer) then find out if it is equal to "txt" Thanks in advance for not telling me to read the manual. Ron -- PLEASE NOTE: comp.infosystems.www.authoring.cgi is a SELF-MODERATED newsgroup. aa.net and boutell.com are NOT the originators of the articles and are NOT responsible for their content. HOW TO POST to co...

How to set path for .M files. How to include, and verify a file in the MATLAB path. In other words I wish to learn how to setup the path for .M file in MATLAB path? Thanks.
undefined ...

How can I use a pdf file as a help file?
Hello to all, Can someone show me some sample code how to hook a pdf file to my VO program as a help file? Thanks! Desmond > Can someone show me some sample code how to hook a pdf > file to my VO program as a help file? Why would you want to use PDFs as help?? The normal way to kick off Acrobat Reader is to use ShellExecute() Eg. ShellExecute( ; SELF:Handle(), ; PSZ("open"), ; PSZ( GetDefault() +"MyAppHelp.pdf"),; NULL,NULL,SW_SHOWNORMAL) -- HTH Steve Quinn Desmond, You normally use HLP or HTML he...

saving files using a variable file name
I would like to have a loop that saves a series of files of different names but it seems like I can't use a variable string as my file name when using save. For example: >> name = 'testname.mat' >> save name saves a file named <name.mat> when I'd like a file named <testname.mat>. Is there a way to do what I am looking for? Thanks. Kasey Kasey Horton wrote: > > > I would like to have a loop that saves a series of files of > different > names but it seems like I can't use a variable string as my file > name > when using save. ...

how to extract path/file name upto the mzximum of two levels from the file name?
Dear Group, I have a input file with the following details, $ cat my_input.dat /A1/b1/c1/file1 /A1/b1/file1 /A2/b1/c1/d1/file2 /A2/b1/file1 /A2/b2/file1 /A3/file1 /A3 /A4 I want to get only the first two levels. I will "unique" this ouput and the final reault has to be, /A1/b1 /A2/b1 /A2/b2 /A3/filename /A3 /A4 (ie, the extracted files/path will have a maximum of two "/" s) How would I get this done in ksh? (awk/sed anything is fine) Thanks... On 2005-10-28, da wrote: > Dear Group, > > I have a input file with the following details, > > $ cat my_inp...

How to set path for .M files. How to include, and verify a file in the MATLAB path. In other words I wish to learn how to setup the path for .M file in MATLAB path? Thanks. #2
undefined ...

Error 3045 Could not use <db file path> File already in use
I'm getting the above error message at the line 'Set db = ...' in the following code (which is called from the autoexec macro before anything else happens). Dim ws as Workspace, db as DAO.Database set ws = Workspaces(0) set db = Currentdb If I remove the 'set ws = ...' line, then the message doesn't appear. But I need the ws for a transactions routine which follows in the same function. I've tried various options for 'set db = ' but with no success. I'm using similar code throughout the database without a problem. Can anyone help? --...

Iteration through File.file? misses entries for which File.file?(entry) == true
Hello everyone, I'm new to Ruby, so I'm most likely making an elementary mistake. However, searching Google didn't help me find my answer, and after mucking around with irb I still haven't figured it out. I wrote a method that was intended to take all of the files in a given directory and put them into an array. Here's the code I wrote: def getFiles(dir) pwdFiles = Array.new Dir.foreach(dir) do |entry| pwdFiles.push(entry) if File.file?(entry) == true end end This works fine when called on the working directory --- that is, getFile...

File, Find References, Copy Files: Truncating Long File Names
Hello All- I just experienced this behavior this morning. It was repeatable. Has anyone else seen this? The file Name was cut off after 57 characters. XP Pro SP2 2006 SP0 Office XP 2003 Pro Best Regards, Devon T. Sowell www.3-ddesignsolutions.com How long was the path name in total? Total including the file extension (.SLDASM) = 174. The file Extension was retained, just the Name was chopped off. These are my customer's files. Best Regards, Devon T. Sowell www.3-ddesignsolutions.com "TOP" <kellnerp@cbd.net> wrote in message news:1128364278.638472.150320@f14g2000...

http://LongPathTool.com
http://LongPathTool.com - unlock files in-use by other applications + Delete and Copy Path Too Long Files The application solves the problem with inability to copy and delete files and folders with long paths or locked by some application. They could be created by virus/adware/different OS/other software. Normally one can't access such files under Windows and therefore can't delete them either. Please check other Features for more details. Also you can download the latest evaluation version on our download page. Long Path Tool uses a variety of methods to delete the pers...

Default Instance Files and Named Instance File Paths
Hello Faculties When SQL2000 is installed as a default instance, all its supporting files as installed in MSSQL\ directory. And after installation as a named instance, the files are added to the MSSQL$InstanceName\ directory. If i keep the default instance files on the primary partition and those of the named instance on another partition, will it cause any trouble? Please help. Thanks in advance Debashish ...

Is it possible to get file path and name from file handle ?
I open so many files so I keep only the handles and not keep all the file paths and names in memory. so is it possible to get the full file path and name from a file handle if I need it ? Thanks. eurolynx99@hotmail.com wrote: > I open so many files so I keep only the handles and not keep all the > file paths and names in memory. so is it possible to get the full file > path > and name from a file handle if I need it ? You might want to take a look at: http://www.ultrasync.net/yofune/?Prog%2FWin32%2FGet%20FileName%20from%20Handle http://msdn.microsoft.com/libr...

concatenating file path and file name for linux systems
Dear all,=20 I have an executable that works fine on my Windows system. I re_built this = exectuable using intel fortran compiler 13.1.3 recently to run on linux mac= hines. On Linux machine, I see a weird behaviour. The created output files are not= created in the output directory I set. =20 I read the output path from an external text input file=20 (1)!open the inputfile below open(1111, FILE=3DSomeInputFile) (2)! read the a line from this inputfile. The line contains a string referi= ng=20 ! to a windows directory path (C:\MyOutputDirectory) or=20 ! to a linux direct...

Capturing File Name As Opposed To The Full File Path
I am using code kindly provided by the Access Web to capture a file path and insert it into a form. The relevant part of the code follows: Function GetOpenFile(Optional varDirectory As Variant, _ Optional varTitleForDialog As Variant) As Variant ' Here's an example that gets an Access database name. Dim strFilter As String Dim lngFlags As Long Dim varFileName As Variant ' Specify that the chosen file must already exist, ' don't change directories when you're done ' Also, don't bother displaying ' the read-only box. It'll only confuse people. ln...

Rename multiple files using names in a text file
Hi, I would like to rename files (jpg's ones) using a text file containing the new names... Below is the code that doesn't work : ***** #!/usr/bin/python #-*- coding: utf-8 -*- from os import listdir, getcwd, rename import re list_names=['new_name1','new_name2'] list_files = listdir(getcwd()) filtre = re.compile("jpg$", re.IGNORECASE) list_jpg = filter(filtre.search, list_files) #strip all element of list list_jpg list_jpg_strip=[] for nom in list_jpg: #print nom.strip() list_jpg_strip.append(nom.strip()) #let's rename : i=0 while i <= len(list_jpg_...

append date to a file name using batch file.
I have a requirement where the current date (or even the file creation date) must be appeneded to a file name present in a specific folder. And how to rename the files if the folder have more than one file with different names. And also, How to handle renaming (appending the date) the files using a .bat file and Scheduling the .bat file using NT/2000 scheduler to run everyday. Thanks very Much. mercury wrote: >I have a requirement where the current date (or even the file creation >date) must be appeneded to a file name present in a specific folder. >And how to rename the file...

append date to a file name using batch file.
I have a requirement where the current date (or even the file creation date) must be appeneded to a file name present in a specific folder. And how to rename the files if the folder have more than one file with different names. And also, How to handle renaming (appending the date) the files using a .bat file and Scheduling the .bat file using NT/2000 scheduler to run everyday. Thanks very Much. mercury wrote: >I have a requirement where the current date (or even the file creation >date) must be appeneded to a file name present in a specific folder. >And how to rename the file...

Getting a File Name from a FILE *
I find myself in the odd situation of trying to determine the name of a file that has been opened somewhere else with an fopen call, so all I have is the FILE * from that fopen call. I perused my favorite online C API reference and did not find a method, but hopefully that means I did not look in the right places (we all know how easy it is to find stuff once you know where to acutally look). So, the question, given a FILE *, can one get back to the name/path of the file that was opened, and if so, how ? Thanks for the assist, Dale Pennington Dale Pennington wrote: > So, the qu...

Getting the file name from a FILE *
Hi We are rewriting the libc for the 64 bit version of lcc-win and we have added a new field in the FILE structure: char *FileName; fopen() will save the file name and an accessor function will return the file name given a FILE *. Questions: What would be the best name for this function? char *fname(FILE *); // lower case, short, similar to other // file functions // clear name but maybe too long? char *FileNameFromFileP(FILE *); What problems could arise with this function? Why is not in the C API? We are considering extending our file functions to handl...

LDB files and file names
Hi, Just wondering if there are any issues involved with using the same names for access files of different types, ex. filename.MDW and filename.MDB. When these are both in use and reside in the same directory, Access creates one LDB file, filename.LDB. Are there any potential problems with this scenario? Tons. You should not do this. -- MichKa [MS] NLS Collation/Locale/Keyboard Development Globalization Infrastructure and Font Technologies Windows International Division This posting is provided "AS IS" with no warranties, and confers no rights. "TR" <t_NoSpam_re...

Web resources about - Obtain file path and file name using file chooser - comp.lang.java.help

Apple Chooser - Wikipedia, the free encyclopedia
The Chooser is an application program for Macintosh systems using the original Mac OS . The Chooser started out as a desk accessory and became ...

Jobseekers can't be choosers, Tony Abbott declares
TONY Abbott says jobseekers on unemployment benefits have no right to reject work just because they can't find their dream job.

Yahoo’s new Tumblr for iOS updated with “stacks” like post type chooser, app attribution
... which was purchased by Yahoo today for a cool $1.1 billion , received an update for iPhone and iPad today that introduces a new post type chooser ...

Tumblr For iOS Updated With OS X Fan-Like Post-Type Chooser And App Attribution
... Tumblr iOS app. What the update does bring are “a couple of cool updates.” No doubt the “cooler” of the two is the app’s new post-type chooser ...

Robbers Can’t Be Choosers: Teens Decline to Steal Man’s Phone Because It Wasn’t a Smartphone
(Photo: Tumblr) One foolproof way to avoid getting your phone jacked by a roving band of hoodlum teenagers? Have a really shitty phone. News.com.au ...

Beggars can be choosers: BlackBerry dumps T-Mobile following spat
Some might consider holding a grudge while your company is struggling to stage a comeback ill-advised, but BlackBerry took it personally when ...

"It is a misunderstanding of freedom... to suppose that choice is not free when the objects between which ...
"It would mean that a person was not exercising his free will when in response to the question whether he preferred vanilla or chocolate ice ...

Google Account Chooser
A few days ago, I mentioned that Google tests a new desktop sign-in page . The new interface is called Account Chooser and this help center article ...

Video: Baker says 'beggars can't be choosers' chicagotribune.com
Video: Baker says 'beggars can't be choosers' chicagotribune.

Dropbox Chooser will make it even harder to keep Dropbox out of your business
CITEworld covers a wide range of technology topics, including smartphones, tablets, software, security, operating systems, mobile, storage, servers ...

Resources last updated: 3/9/2016 10:12:29 AM