I frequently have to send JS files through Outlook, which means that I have to modify the extension of the file to txt or the like so the recipient can receive it. I'd ideally like to implement a file watcher in WebStorm to simply output a child file with .txt appended to it similar to how it'll show a child CSS file for a LESS file.
To sum up, given a file named "file.js", I would like it to output a "file.js.txt" as well whenever I make a change.
Is there any simple way to go about doing this?
You can create a .bat file (shell script) that would copy files and then configure it as a file watcher. Like:
copy %1 %2 /Y
Watcher settings:
Program: path/to/your/batfile.bat
Arguments: $FileName$ $FileName$.txt
Working directory: $FileDir$
Output paths: $FileName$.txt
Related
I am trying indirect file load in Informatica.
I put below files in $PmSrcFilesDir (from here the workflow task pick up files)
-list.txt
-production_plan_20210906.csv
-production_plan_20210907.csv
The list.txt files contains the csv file names only.
I configured below options:
Source filetype- Indirect
Source filename- list.txt
Source file directory- $PMSourceFileDir
After running the workflow it shows error- as
FR_3000 Error Opening File...No such file or directory
You can give absolute path in list.txt.
/Path/to/file/production_plan_20210906.csv
/Path/to/file/production_plan_20210907.csv
You can use command task or shell script to get absolute path and file name.
Pls check session log, which file it cant read - list file or main file. If list file mention $PMSourceFileDir correctly in param file.
Now, make sure informatica user (user that runs infa server) has read access to those data, list folders and files. Admin can help.
I am working on a project where I have to read in serveral pre-existing CSV (dog.csv, horse.csv, etc.). I want to know how would I add these file into my project so that I may test to see if my print functions work (the code is written in c++). Would I have to copy and paste the files into the debugging folder or would I place it under the test folder of the project?
You can include the files in your project in whatever (sub)folder you wish by using Right click -> Add -> Existing Item. Then, right-click on each file and choose Properties. Set up "Copy to output directory" to "Copy if newer".
Then after build, your files will be copied into the bin/debug folder.
To read the file, you can just use:
System.IO.File.ReadAllText("dog.csv");
Another possible way is to add a file within project, right click and select properties, and then in Copy to Output Directory, select Copy always. This way, csv file will be automatically copied in your debug and release packages too.
string executableLocation = Path.GetDirectoryName(
Assembly.GetExecutingAssembly().Location);
string csvLocation= Path.Combine(executableLocation, "file.csv");
Above code will read file location from bin directory where your csv file will be stored.
This link should help guide you how to add CSV files to a project.
If you wanted to do a down and dirty way you could just save the CSV's somewhere on your local machine, and then hard code the file path to that location.
Example:
c:\test\Dog.csv and then set that as a variable for whenever you need to read in the csv file.
In my program I use multiple module files. In order to keep main folder clean I moved all of them in separate folders and made necessary changes to my shell script. Everything was done correctly as now I am able to compile and run the program. Unfortunately, Sublime Text 3 doesn't see .mod files located not in the main folder. On lines like this:
use mymodule
it says:
Fatal Error: Can't open module file ‘mymodule.mod’ for reading at (1): No such file or directory
How can I fix this?
In Sublime Text go to Preferences->Package Settings->SublimeLinter->Settings - User. There in the block "gfortranfixedform" or "gfortranmodern" (depends on what form you are using) add an argument: "args": ["-Ipath/to/modfiles"], where path/to/modfiles is a directory with your .mod files.
Maybe you have to change the line in config to this:
"shell_cmd": "gfortran '${file}' -Ipath/to/module -o '${file_path}/${file_base_name}'"
where path/to/module is a directory with your .mod file. (Just a suggestion, don't know anything about Sublime editor.)
If I add a "File Watcher" to compile .less files into .css files in webstorm with the default option it makes the .less file becomes a "node" and the .css file is created inside it.
The macro system seems to me a little tricky, I just want to create the .css file inside the same "style" folder in which the .less file is.
Basically now I have a structure like this:
root
|style
|-style.less
|-style.css
and my goal is to obtain a structure like this:
root
|style
|-style.less
|-style.css
any suggestion?
You will have to edit the 'File Watcher', there is Setting 'Arguments' this is what comes after the lessc command. Put somthing like this:
$FileName$ $FileNameWithoutExtension$.css
this should create your output file (.css) in the same directory.
I want to write a log file for my application. The path where I want to store the file is:
destination::"C:\ColdFusion8\wwwroot\autosyn\logs"
I have used the sample below to generate the log file:
<cfset destination = expandPath('logs')>
<cfoutput>destination::"#destination#"</cfoutput><br/>
<cflog file='#destination#/test' application="yes" text="Running test log.">
When I supply the full path, it didn't create a log file. When I remove my destination, and only provide a file name, the log is generated in the ColdFusion server path C:\ColdFusion8\logs.
How can I generate a log file in my application directory?
Here is the description of attribute file according to cflog tag specs:
Message file. Specify only the main part of the filename. For example,
to log to the Testing.log file, specify "Testing".
The file must be located in the default log directory. You cannot
specify a directory path. If the file does not exist, it is created
automatically, with the extension .log.
You can use cffile tag to write information into the custom folder.
From the docs for <cflog>:
file
Optional
Message file. Specify only the main part of the filename. For example, to log to the Testing.log file, specify "Testing".
The file must be located in the default log directory. You cannot specify a directory path. If the file does not exist, it is created automatically, with the extension .log.
(My emphasis).
Reading the docs is always a good place to start when wondering how things might work.
So <cflog> will only log to the ColdFusion logs directory, and that is by design.
I don't have CF8 handy, but you would be able to set the logging directory to be a different one via either the CFAdmin UI (CF9 has this, I just confirmed), or neo-logging.xml in WEB-INF/cfusion/lib.
Or you could use a different logging mechanism. I doubt it will work on a rusty of CF8 install, but perhaps LogBox?