Results 1 to 5 of 5

Thread: Get environment variable path of server from local system

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,332
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    317
    Thanked 871 Times in 858 Posts

    Default Re: Get environment variable path of server from local system

    Sounds like the OP's scenario is that he reads the serverFile.xml file, retrieves the property element with the "FileName" attribute, reads its "value" attribute (which contains the literal string "%FILE%"), and is then stuck because he has no way to remotely determine the value of %FILE% on the server machine.

    It doesn't sound like there is any server-side program at all, it's just being accessed as a remote file system.

    But if the remote file system can set the value of an environment variable to point to a specific file, then why can't that path simply be written to the XML file instead?

    And as a comment, "FILE" seems like a particularly bad choice for an environment variable that forms a critical part of a processing system. "XYZ_APP_FILE" or something a bit more app-specific might be a better choice.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts

    Default Re: Get environment variable path of server from local system

    Quote Originally Posted by d_stranz View Post
    Sounds like the OP's scenario is that he reads the serverFile.xml file, retrieves the property element with the "FileName" attribute, reads its "value" attribute (which contains the literal string "%FILE%"), and is then stuck because he has no way to remotely determine the value of %FILE% on the server machine.
    Right, thus the client needs to pass on the path with the variable intact so that the server can interpret it.

    Quote Originally Posted by d_stranz View Post
    It doesn't sound like there is any server-side program at all, it's just being accessed as a remote file system.
    Well, the comment said server access happens through a REST API, so I assumed it would have some for of "get file" call.
    This call needs to support paths with environment variable for this to work properly.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,332
    Qt products
    Qt5
    Platforms
    Windows
    Thanks
    317
    Thanked 871 Times in 858 Posts

    Default Re: Get environment variable path of server from local system

    Well, the comment said server access happens through a REST API, so I assumed it would have some for of "get file" call.
    This call needs to support paths with environment variable for this to work properly.
    Ah, yes, missed that. So there must be some server-side code running, and that's where the environment variable needs to be resolved.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 2
    Last Post: 19th October 2017, 23:25
  2. Replies: 7
    Last Post: 31st May 2012, 21:52
  3. Qt Creator PATH Environment Variable
    By dohzer in forum Qt Tools
    Replies: 3
    Last Post: 4th December 2010, 06:50
  4. Replies: 8
    Last Post: 17th October 2009, 08:10
  5. System environment variable
    By fahlen in forum Qt Programming
    Replies: 4
    Last Post: 27th November 2007, 19:02

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.