problem about relative-path-Collection of common programming errors


  • teresko
    php codeigniter error-handling relative-path
    I am using code igniter, and I need to be able to read and/or include some html files, so I created an includes directory in the application folder. Using CI what is the best way to access this directory?In my controller I have tried:private $cms_temp_folder = APPPATH . ‘includes/’;But that gives me the error:Parse error: syntax error, unexpected ‘.’, expecting ‘,’ or ‘;Am I approaching this right, or should I be doing it another way?

  • John Saunders
    c# asp.net visual-studio-2010 httpresponse relative-path
    I have an asp.net website that writes some data to a TXT file using a relative path. It does so with this command: string currentDirectory = “./”; string individualDeviceTxt = “myfile.txt”; System.IO.StreamWriter fileW3 = new System.IO.StreamWriter(currentDirectory + individualDeviceTxt);The file writes successfully to the following path:C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0however, later on, when I try to transmit this file to the user, the relative directory ./

  • supertreta
    java jar jni loading relative-path
    PART 1:Hi guys,I am developing a Java application that should be release as a jar. This program depends on c++ external libraries called by JNI. To load them, I use the method System.load with an absolute path and this works fine.However, I really want to “hide” them inside the jar, so I have created a package to collect them. This forces me to load an relative path – the package path. By this approach, I let the user run the jar in any directory, without being worried about linking the dll’s or

  • viky
    c# wpf binding path relative-path
    So I’m trying to display an image that is ouside the path of my application. I only have a relative image path such as “images/background.png” but my images are somewhere else, I might want to choose that base location at runtime so that the binding maps to the proper folder. Such as “e:\data\images\background.png” or “e:\data\theme\images\background.png”<Image Source=”{Binding Path=ImagePathWithRelativePath}”/>Is there any way to specify either in XAML or code behind a base directory fo

  • Shekhar
    c# relative-path app-config
    I am working on a project in which I have many text and xml files. I read those from my program at runtime. I have kept paths to those files in app.config file, but all the paths are absolute paths like “C:\my_project\help_files\rejectList.txt” . If I keep only “\help_files\rejectList.txt” path, program throws filenotfound exception. Can anyone please tell me how to set relative paths in C# applications? I would like to set something like “$root\help_files\rejectList.txt” and at runtime $root sh

  • Mujtaba Bhat
    c# resources relative-path license-key
    I have a license file that I need to access at runtime. I have added license file to the resources folder. I need to call a method on the run time which will look for the license file.test.CheckLicenseFile(“PathOflicenseFile”);I would like to know how can i get this path at runtime? Also please tell me what properties should I set for this license file i.e content, embedded resource etc, and copy to output or not. Please note that my project is of type windows control library(usercontrol) i.e. i

  • Halo
    java gwt relative-path ireport subreport
    I’m working with iReport 3.5.0, and I’m using a subreport inside my main report. I don’t want to give the absolute path for the subreport expression, but for example if I just give “bpSubReport.jasper” as the subreport expression (because sub and main are in the same directory), then iReport can find bpSubReport.jasper and compile the main report into bPReport.jasper, but my Java (gwt) application can’t. It throws the exception net.sf.jasperreports.engine.JRException: Could not load object from

  • bloodix
    c# dll reference relative-path absolute-path
    I have compiled my project. some of the project added Dlls by reference have an absolute reference. When I try to run my project on another machine it looks for the Dlls from the original project path. how can I make the project look for the Dlls in the relative path.

  • Charles
    php zend-framework relative-path messageboard
    I’m trying to include a premade messageboard, Phorum, into one of my Zend projects. Phorum is a relatively large and intricate web of PHP includes. My website already has a signup, so I’m trying to combine the two login systems into one. What I’ve done is to make a controller that includes the Phorum index.php. This will let me use the authentication system I’ve set up. My problem is that, since I’m bootstrapping, all the relative filepaths within Phorum’s index.php seem to try to begin at

  • Ivan Feric
    java osx file relative-path absolute-path
    I am using a Mac and I am new to it. Here is my question:There is a folder that I require to include as a File object in Java. When I try this:File firefoxProfileFolder = new File(“/Users/prime/work/dmall/selenium/src/test/resources/firefoxprofile”);It works fine. This code is located in file: /Users/prime/work/dmall/selenium/src/test/java/com/dmall/utils/WebUtil.javaBut when I try this:File firefoxProfileFolder = new File(“../../../../resources/firefoxprofile”);I can not load the folder. So the

  • Nickon
    visual-studio reference visual-studio-2012 relative-path
    I wonder if it’s possible to make something like this…I have a project in VS2012 that uses two referenced VS projects (DLLs are being created during compilation) and some other DLLs (external libraries etc.). Now I want to clean up my compilation and place DLLs in two folders: e.g. Internals and Externals.How to make it possible? The problem is that my compiled .exe app file wants the DLLs to be placed in the main folder (near to it) – so if it needs to load the library from DLL it crashes…I

  • Dimitre Novatchev

  • DanM
    c# wpf visual-studio relative-path
    I have an IValueConverter in WPF that converts a relative file path to a BitmapImage.The Code:public class RelativeImagePathToImage : IValueConverter {public object Convert(object value, Type targetType, object parameter, CultureInfo culture){var relativePath = (string)value;if (string.IsNullOrEmpty(relativePath)) return Binding.DoNothing;var path = “pack://application:,,,/” + value;var uri = new Uri(path);return new BitmapImage(uri);}public object ConvertBack(object value, Type targetType, obje

  • Josh
    python relative-path hang absolute-path unhandled-exception
    I have some python scripts that run via cron, and they no longer exit correctly when the script is called with an absolute path. They will hang until the process is terminated. I believe it happened after I moved /var and /home to a different partition.I checked into the environment variables and couldn’t see anything obviously wrong, this happens either when run with cron or a bash subshell, but not when run directly.If I run it as a subshell it hangs until I kill it (ctrl-c) and then gives m

  • John Saunders
    c# .net silverlight-5.0 relative-path bin
    I have a WCF Service that I call from the client of my silverlight application, and I pass it a string filename parameter and a string parameter containing xml. In the service method I construct an XDocument instance containing the xml string, and then save it to a file in the ClientBin folder on the server. I have been using an absolute path, and now am trying to switch to a relative path, but am unsure how to do it correctly. My code looks like this:public void WriteXmlToServer(string filename

  • Fliper333
    php windows relative-path imagick
    I’m trying to install imagick PHP extension on windows. It was working on PHP 5.2, PHP 5.3 but I have problems with PHP 5.4.Imagick version: ImageMagick-6.7.6-3-Q16-windows-dll. Module is working. I can see imagick in phpinfo().The problem is, that imagick does not recognize relative path to files. For example, if I have simple index.php and a.jpg in the same folder, I can’t use $im = new imagick(‘a.jpg’); because I get exception:Fatal error: Uncaught exception ‘ImagickException’ with message ‘u

  • Uri Klar
    asp.net forms-authentication relative-path
    This problem is driving me crazy… I’m using ASP.Net’s Forms Authentication. As you may know, forms authentication adds a query string to the url stating what page to return to after authenticating. This parameter is called ReturnURL.My problem is, I can’t seem to be able to load .js and .css files. I have to use a relative path. This is how i’m finding the path to my resource files:<link href=”~/Styles/Site.css” rel=”stylesheet” type=”text/css” /><script type=”text/javascript” src=’&l

  • Steve Green
    php html url xampp relative-path
    I’m using XAMPP on my home machine and also using it as a web server. I have a main folder which is for my site, I then have a dev folder where I’m trying to work on a new site. (not sure if this is relevant info but worth mentioning)On my local machine the site is c:/MySite/Dev within Dev I have something along the lines ofDevassetscssjsincludesfooterheadercoreinitfoldersubfolderfiles.phpindex.phpinit is included at the top of every page, header and footer includes are also included. Within h

  • Adam Zalcman
    http url port relative-path
    We are all familiar with relative paths: A relative path to ./images/hello.jpg from http://www.domain.com/hey links to http://www.domain.com/hey/images/hello.jpg.Problem: How do you state a relative path to http://www.domain.com:1234 when you are at http://www.domain.com/hey?

  • Emanuil Rusev
    php apache relative-path
    Create a PHP project that consist of 2 files – index.php that contains the code below and another file (in the same directory) called example.png.echo file_exists(‘example.png’)? ‘outside the handler – exists’: ‘outside the handler – does not exist’;register_shutdown_function(‘handle_shutdown’);function handle_shutdown() {echo file_exists(‘example.png’)? ‘inside the handler – exists’: ‘inside the handler – does not exist’; }foo();Run index.php.Here’s what you’ll get:outside the handler – exists

  • rffaguiar
    javascript path relative-path web-deployment
    I have some websites on development and production separated by folders like: localhost/demo1 localhost/demo2..demo3 and so on. The problem is my JS. Everytime I deploy them I have to change some paths on JS files, specially the ones that uses AJAX.Suppose the code below is the URL parameter in jquery ajax://on dev: url: ‘/demo1/some-action.php’//on prod: url: ‘/some-action.php’How do you handle this on JS?

  • Schneider
    java apache normalization relative-path absolute-path
    I’m using a the normalize function to get the absolute path from a String,org.apache.commons.io.FilenameUtils.normalize(String)But when I use just normalize(String) I get :The method normalize(String) is undefined for the type MyClassI tried : import org.apache.commons.io.FilenameUtils;I downloaded the library from Apache website, and linked it to my project but I get the same error.I don’t want to write everytime the whole line to call the function.Is there any solution for this ?Thanks

  • meiryo
    javascript jquery href relative-path
    The following code will return as undefined:$(‘a’).each(function () {console.log($(this).pathname); });My anchors look like this: <a href=”../foo/”>Foo</a>What am I doing wrong? If it is not possible then how can I return the full url?

  • Vadzim
    java ant classpath relative-path build.xml
    I want to put path of different directory (which contains jars, presently on d:/ext_jars). After running the build.xml. I want that path should take that runnable jar.Currently that jar is giving me errors because of classpath is not present (which was previously under c:/project/lib/*.jars, converted into D:/ext_jars).Please help me, that how can I set that external directory in classpath of build.xml?My code in : build.xml<?xml version=”1.0″?> <project name=”MyProject” default=”deploy

Web site is in building