How do i map from file name to the device it resides on

hi
i need to find a way to map from a file name to the disk device it resides on( so i can do ioctl to that device ).
i know that stat(2) returns a dev_t value, but i don't know how to translate from that dev_t to the device name( e.g. /dev/dsk/c0d0... )
THANKS
Gabriel

thanks for the reply,
i'm using a similar mechnisem on linux - using getmntent(3) to find the longest prefix of the filename realpath(3).
i was actually looking for a mechnisem similar to the devname(2) syscall on the BSD os. with this call the kernel do all the work for you simply by mapping from dev_t( which the kernel stored in the indoe) to the device name by keeping a simple mapping table.
if this mechinsem doesn't exists i will have to (eventually) duplicate the kernel work(namei) and create my own mapping.
THX
gabriel

Similar Messages

  • Globally removing an illegal symbol from file names in the finder

    I recently discovered that my method of dating files makes use of the illegal symbol, '/'. Now I have thousands of files with that symbol in them and am having trouble transferring them to my new hard drive. Is there a was that I can globally remove that symbol from the file names via the finder?

    Hi
    download filelist.dmg
    Double click on it to open it. Drag the Filelist app' into your Application Folder, a good a place as anywhere to keep it.
    Open the FileList application, it should show as a window.
    Drag a file or a group of files onto that open window- the left hand side pane.
    ... and there you can manipulate the prefix and suffix of the files to give them new file names.
    Create a file in text edit, type something in it, save is as test.rtf, and then drag it into the FileList app and experiment with changing its name.
    When you get the hang of it, do a group of files as a batch.
    I tried to do what you wanted to do in your initial post and was successful, so just have a play around with it.
    regards roam

  • How do i change multiple file names to the same name w/ a number value?

    I use Windows machines and Macs at my office.  In Windows I can take a group of files, let's say JPG's of a factory tour, and when I upload them into Windows, I can "select all", right click and chose "rename".  I rename the first file "102511 Widget Tour (1)" and press "enter" Windows automatically renames all the JPG's to "102511 Widget Tour" and progresses the number in the parentheses.  In OS X there is not even a "rename" function when multiple items are selected.  I've looked at using Automater, but it seems that I would have to construction a new action each time.  Any ideas?

    If you have Aperture it can do it for you.
    Alternative:
    I suggest a third part app: Renamer
    http://incrediblebee.com

  • Batch document title from file name?

    Forgive the newb question on a fairly simple matter.
    I want to create File Info: Document Titles from file names, minus the extension, for about 400 images.
    Is this possible with Batch rename, if so what am I missing?
    Thanks,

    I am unclear how a batch rename will enter data into File Info: Document Title.
    I have never used them but you might look at metadata templates.  Several sites on web on how to set them up and what they will do for you.

  • How can I assign image file name from Main() class

    I am trying to create library class which will be accessed and used by different applications (with different image files to be assigned). So, what image file to call should be determined by and in the Main class.
    Here is the Main class
    import org.me.lib.MyJNIWindowClass;
    public class Main {
    public Main() {
    public static void main(String[] args) {
    MyJNIWindowClass mw = new MyJNIWindowClass();
    mw.s = "clock.gif";
    And here is the library class
    package org.me.lib;
    public class MyJNIWindowClass {
    public String s;
    ImageIcon image = new ImageIcon("C:/Documents and Settings/Administrator/Desktop/" + s);
    public MyJNIWindowClass() {
    JLabel jl = new JLabel(image);
    JFrame jf = new JFrame();
    jf.add(jl);
    jf.setVisible(true);
    jf.pack();
    I do understand that when I am making reference from main() method to MyJNIWindowClass() s first initialized to null and that is why clock could not be seen but how can I assign image file name from Main() class for library class without creating reference to Main() from MyJNIWindowClass()? As I said, I want this library class being accessed from different applications (means different Main() classes).
    Thank you.

    Your problem is one of timing. Consider this simple example.
    public class Example {
        public String s;
        private String message = "Hello, " + s;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example();
            ex.s = "world";
            System.out.println(ex.toString());
    }When this code is executed, the following happens in order:
    1. new Example() is executed, causing an object to constructed. In particular:
    2. field s is given value null (since no value is explicitly assigned.
    3. field message is given value "Hello, null"
    4. Back in method main, field s is now given value "world", but that
    doesn't change message.
    5. Finally, "Hello, null" is output.
    The following fixes the above example:
    public class Example {
        private String message;
        public Example(String name) {
            message = "Hello, " + name;
        public String toString() {
            return message;
        public static void main(String[] args) {
            Example ex = new Example("world");
            System.out.println(ex.toString());
    }

  • How to hide the file name (the bizarre number assigned by the camera) when exporting an image version in aperture from an album. Pl understand I want to keep the file name in the project library version.

    how to hide the file name (the bizarre number assigned by the camera) when exporting an image version in aperture from an album. Pl understand I want to keep the file name in the project library version.

    Within Aperture you have Images, which are constructed on-the-fly from two files (the Master and the Version).  You get an image-format file _only_ when you export an Image.  You select the file name (usually a scheme) when you create an image-format file (that is, when you export).  Look under "Aperture→Presets→File Naming" for built-in Presets.  You can, of course, create your own or customize any provided.
    The Preset is applied to only the file newly created by your "export" command.  It is not applied to the Image in Aperture (unless you rename your Versions or your Masters).

  • Does anyone know how to use pages so you can export pdfs from the internet and automatically drag words from the document into the file name of the pdf (i.e., author, title of a scientific paper)

    Does anyone know how to use pages so you can export pdfs from the internet and automatically drag words from the document into the file name of the pdf (i.e., author, title of a scientific paper). For example, if I am downloading a paper by smith called "Surgery" that was published in 2002, it will automatically set the file name in the download to smith- surgery 2002. I have heard pages is smart enough to do this.
    thank you

    Pages can export only its own documents. They may be exported as PDF, MS Word, RTF or Text files.
    Pages can import (ie. Open a file as, or Insert a file into, a Pages document) documents in several formats, but won't rename the document as you describe. Documents that can be Opened (eg. Text, AppleWorks 6 WP, MS Word files) are converted to Pages documents, and retain their original names, with .pages replacing the original file extension. Files that can be Inserted (generally .jpg, .pdf and other image files) become part of the existing Pages file and lose their names.
    It may be possible, using AppleScript, to extract the text you want and to Save a Pages file using that text as the filename, but that would depend in part on being able to identify which text is wanted and which is not.
    How will the script determine where the author's name begins and where it ends?
    How will the script recognize the beginning and of the title, an decide how much of the title to use in the filename?
    How will the script recognize the year of publication?
    For papers published in a specific journal, with a strict format for placing each of these pieces on information, or containing the needed information as searchable meta data in the file, this might be possible. But it would require knowledge of the structure of these files, and would probably handle only papers published in a specific journal or set of journals.
    Outside my field of knowledge, but there are some talented scripters around here who might want to take a closer look.
    Best of luck.
    Regards,
    Barry

  • WCF Service and Sharepoint Form library : How i can read a access a form libray and query a item from file name and read form xml in WCF service ?

    WCF Service and Sharepoint Form library : How i can read or access a form libray and query a item from file name and read form xml in WCF service ?
    Ahsan Ranjha

    Hi,
    In SharePoint 2013, we can take use of REST API or Client Object Model to access the SharePoint objects like Form Library.
    SharePoint 2013 REST API
    http://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx
    http://blogs.technet.com/b/fromthefield/archive/2013/09/05/working-with-sharepoint-list-data-odata-rest-and-javascript.aspx
    SharePoint 2013 Client Object Model
    http://msdn.microsoft.com/en-us/library/office/fp179912(v=office.15).aspx
    http://msdn.microsoft.com/en-us/library/office/jj193041(v=office.15).aspx
    With the retrieved file, we can then use XmlDocument object to parse it and get the values you want:
    http://weblogs.asp.net/jimjackson/opening-and-reading-an-xml-file-in-a-document-library
    http://stackoverflow.com/questions/1968809/programatically-edit-infopath-form-fields
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to get list of file names from a directory?

    How to get list of file names from a directory?
    Please help

    In addition, this:
    String filename = files;Should be this:
    String filename = files;
    That's just because he didn't use the "code" tags, so [ i ] made everything following it become italicized.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How do I call image file names from MySQL & display the image?

    Hello everyone,
    I have image file names (not the full URL) stored in a MySQL database. The MySQL database is part of MAMP 1.7 and I am using Dreamweaver CS3 on a Mac Book Pro.
    I would like to create a catalog page using thumbnails, and PayPal buttons displayed within a table, in rows. With the image centered and the PayPal button directly underneath the image.
    How do I use PHP to call the thumbnail images as an image not the file name, to be displayed in the table?
    Thanks in advance.

    slam38 wrote:
    How do I use PHP to call the thumbnail images as an image not the file name, to be displayed in the table?
    Open the Insert Image dialog box in the normal way, and navigate to the folder that contains the images. Then copy to your clipboard the value in the URL field, and click the Data Sources button. The following screenshot was taken in the Windows version, but the only difference is that Data Sources is a radio button at the top of the dialog box in Windows. It's a button at the bottom in the Mac:
    After selecting Data Sources, select the image field from the approriate recordset. Then put your cursor in the URL field and paste in the path that you copied to your clipboard earlier.

  • How can I extract metadata from file names?

    If I want to extract metadata from file names? How can I do that? I want to read through the file names and when I get to a certain character ("-"), I can take the string just before that character and store it in a column in SharePoint. Is this
    do-able through scripting? 

    If I want to extract metadata from file names? How can I do that? I want to read through the file names and when I get to a certain character ("-"), I can take the string just before that character and store it in a column in SharePoint.
    Is this do-able through scripting? 
    You should be able to leverage the split method.
    In PowerShell It would look like:
    # Gather the file name
    $file = "myawesome_filename-Month-Day-Year-Ect.doc"
    #split the file name by the "-" character
    $file = $file.split("-")
    # Use a foreach Loop to gather the individual items.
    foreach ($item in $file) {
    write-host $item
    #Outputmyawesome_filename
    Month
    Day
    Year
    Ect.doc
    # If you want to only grab the first item, you can do $file[0] <-- powershell starts counting with zero base.
    $file[0]
    #output
    myawesome_filename
    Entrepreneur, Strategic Technical Advisor, and Sr. Consulting Engineer - Strategic Services and Solutions Check out my book - Powershell 3.0 - WMI: http://amzn.to/1BnjOmo | Mastering PowerShell Coming in April 2015!

  • When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the original file name being replaced during the downloading process?

    When someone other than myself downloads an image from my web album, a dynamically generated file name replaces the original file name.  How I can prevent the file name being changed during this downloading process?

    Hi Glenyse,
    Here are my steps.
    1.  I upload multiple image (jpg) files onto my photo album.
    2.  I select the "sharing" by email option for this album.
    3.  I enter the recipient's email address.
    4.  The recipient receives my message and clicks on the link.
    5.  The recipient accesses my photo album and clicks on one of the images.
    6.  The image opens up to its own screen.
    7.  The recipient selects the "download" and then save file option.
    Here is the part I do not understand.  For some reason, during this "download" process, the original name which I have given to the file is replaced by different name.  So I was hoping that someone knows how to prevent the file name from being changed during the "download and save" process.
    Much appreciated if you can help me find a solution to this problem.
    Mary  

  • I migrated all data from old PC to new and iTunes successfully transferred to new PC. When I click on a song it says it cannot locate the original. How does one map iTunes file to iMusic to enable play from original files ?

    Subject: Migration
    I migrated all data from old PC to new and iTunes successfully transferred to new PC. When I click on a song it says it cannot locate the original. How does one map iTunes file to iMusic to enable play from original files ?

    Subject: Migration
    I migrated all data from old PC to new and iTunes successfully transferred to new PC. When I click on a song it says it cannot locate the original. How does one map iTunes file to iMusic to enable play from original files ?

  • Need help with EXS24 "read velocity range from file name"

    I am trying to import 127 drum samples to a single key using the option shown here. The option says "Map to key dropped on and read velocity range from file name". I can find no documentation in the manuals on how to do this. What is the syntax required in the file name to make this work? I need to do several of these imports. The capability is cleary there, but I need help on how the file name should be formatted. My thanks to anyone who can help.

    Hi
    Not a direct answer to your question, but if you are doing a lot of sample mapping etc, you may want to check out Redmatica's KeyMap Pro or the simpler Keymap 1:
    http://www.redmatica.com
    CCT

  • How to import MP3 with file name into library, rather than tag?

    I've been given a CD with about 200 MP3s of lectures. They are to be listened to in order, and the file names reflect the order number, like "lecture 1", "lecture 2", etc. However, when I drag them all into iTunes, the names in the iTunes library don't include the file names - they are simply "lecture", which I guess must come from a tag in the MP3 file. So iTunes is ignoring the file name and thus I end up with 200 entries in my iTunes library that can't be ordered properly. How can I get it to use the file name when importing?
    Mike

    If you have your iTunes preferences set to keep your iTunes Music folder organized, it's possible that even the file names have changed according to the files' tags. In that case, you'll need to (at least temporarily) disable this option and import the files from your CD again.
    Once you're sure the files have been successfully added to your iTunes library and the file names kept intact, you can use the Filenames to Song Names script from Doug's AppleScripts for iTunes.
    This should get everything sorted out.

Maybe you are looking for

  • DVD Error (help!)

    hallo. the reason i am writing today is because i am getting the following error message when i insert a dvd that i just rented from my local retailer: "You have inserted a disk containing no volumes that Mac OS X can read. To continue with the disk

  • Reg:IDOC Sender side settings

    Dear All, My scenario is IDOCPIMDM I have created all the basic ALE settings and they are, SAP R/3: 1)RFC Destination (SM59) 2)Logical system 2)Port (We21) 3)Partner Profile (WE20) name same as logical system SAP XI: 1) RFC Destination (SM59) 2) Crea

  • Elan SmartPad and TrackPoint zooms when scrolling in L430

    Whenever I scroll using my SmartPad: either with the "Edge Scroll" or the "Two-Finger Scroll" or when I scroll using the TrackPoint+its middle button, my web browser zooms in/out. Just as if Ctrl was being pressed. I have deactivated all the zooming

  • Business Blueprint - Table Names

    Hello all, I am busy with filling the Solution Manager with Processes for a Testing Session. Following the steps within the standard SAP way, it will consume quite a lot of time. Does anybody know witch tables I have to fill, to build the SolMan Stru

  • Transport Dependency check

    Hi, How to enable transport dependecy check for transport that are to be imported. When i try to import a request from STMS_IMPORT, it should check for any dependecy of the transport which has been used or modified the same object and it should promp