pathname

Get canonical path from pathname

萝らか妹 提交于 2020-05-13 07:01:34
问题 I am writing a kernel module that hijacks several system calls. Several of the system calls take paths as parameters. For my purposes, I need to work with full paths, but since these parameters are passed as strings, it could be anything like "documents" , "/home/main/../bob" , or "../lib" . I need to get the real paths of these references, but I don't know which function to use or which information I need (e.g., the current working directory, etc.). The kernel obviously has some way of

Get canonical path from pathname

拥有回忆 提交于 2020-05-13 07:00:06
问题 I am writing a kernel module that hijacks several system calls. Several of the system calls take paths as parameters. For my purposes, I need to work with full paths, but since these parameters are passed as strings, it could be anything like "documents" , "/home/main/../bob" , or "../lib" . I need to get the real paths of these references, but I don't know which function to use or which information I need (e.g., the current working directory, etc.). The kernel obviously has some way of

Strange behavior from .NET regarding file paths

丶灬走出姿态 提交于 2020-01-14 09:15:27
问题 I couldn't find any information on this through professor Google, so here I am. Take the given path name and paste it into Windows Explorer. I stumbled across this after discovering bug in my code that generated the paths with an extra '.' in the path name before a directory \ separator... @"C:\\pathto.\file.ext" In code, .NET will accept the path when calling File.Create and a file will be generated, but at this path: @"C:\\pathto\file.ext" Copying C:\\pathto.\file.ext into Windows Explorer

Highlighting current page in the nav

此生再无相见时 提交于 2020-01-06 19:46:09
问题 I need to highlight the current page in my left nav. The nav has to be loaded externally via an .shtml include: <!--#include file="leftnav-menu.inc"--> My urls take the form of: www.xxx.com/mission-critical.shtml but sometimes just: www.xxx.com/energy.shtml (eg one word no hyphen) My nav lists it as 'Mission critical' How can I highlight the ul li with "class=selected"? I've seen something like this: $(function(){ var path = location.pathname.substring(1); if ( path ) $('.leftmenuNav ul li a[

What is path //, how is it different from /

放肆的年华 提交于 2019-12-28 04:23:08
问题 We know root directory is /, and according to posix, there is another directory // which differs from /. When you ls / and ls //, the output is the same, so as stat, however if you cd / and cd //, they are different, though the directory content are the same. That really confused me. Anyone got an answer? 回答1: From Bash FAQ: E10) Why does `cd //' leave $PWD as `//'? POSIX.2, in its description of `cd', says that *three* or more leading slashes may be replaced with a single slash when

maven-jetty plugin not using correct paths

我与影子孤独终老i 提交于 2019-12-25 01:12:49
问题 I am using the jetty-maven plugin to deploy a web-app for integration testing. I have a project which consists of a two POMs. One in the root, and one in a directory in the project root (call this the webapp directory). When I run the integration test from maven (which uses the jetty-maven plugin), in the webapp directory, it works perfectly fine. However, when I run it from the root directory, it goes inside the webapp directory and runs the test but for some reason it gets the paths wrong.

Play sound file from within VBScript when msgbox appears

安稳与你 提交于 2019-12-22 11:38:15
问题 I am trying to play a sound file from within a VBScript when a certain msgbox appears. The only problem is that I will be sending this elsewhere and the person who receives it won't have the same pathname as the audio file that I want to play. I was thinking about putting all of the sound files that I want to use in the same folder as the script and then sending that folder, but I don't know how to make sure the sound file will play. So I guess the biggest question is how to generalize the

How to find an EXE's install location - the proper way?

点点圈 提交于 2019-12-17 09:48:50
问题 I am making a software in C# and MATLAB that calls another software (CMG) to do some processing. My problem is that the address of the software I have put in my program is only correct on my personal computer and not on the customers' computers (I don't know what would be the path to CMG software on their computer). How can I provide a general form of the address in order to make it work on every computer? The following is the path I call from my MATLAB software: C:\Program Files (x86)\CMG