w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Unable to access Samba folder from Windows (Using Raspberry Pi XMBC as a Samba Server)
That may depend on the directory and file rights. If the us who runs smb have no access rights, you can't read or write files. You can find out file permissions with ls -la you will also see owner and owner group. You can try to set read and write permissions for all (chmod 777 directory -R). If this was the problem, then you should give read and write permissions only to the user that runs smb. Set permissions for all back to 0 (770) because of security reasons. Here you find a tutorial on set up samba for Rasapberry Pi.

Categories : Windows

qt transfer a file from local to a samba shared
You can not do that QFile just spports local files but you can mount it to a posix folder and access to that folder. You can find a guide about how to mount a samba shared folder here

Categories : C++

iOS file sharing with SAMBA / CIFS protocol
If I understood you correctly you want to connect with your app files via WiFi . Basically you need to open a local server within your app. CocoaHTTPServer may be help you with this issue.

Categories : Iphone

How Should I Debug Samba with GDB
Download samba source code from http://www.samba.org and compile it (without source code, it will be impossible to do symbolic debugging). Stop or kill any other samba instances. Start samba under gdb: gdb <path/to/compiled/smbd> Specify smbd parameters: set args -i -M single Parameters -i -M single force smbd to start as single process, do not daemonize and print all messages and errors to stdout/stderr. Now, you can set breakpoints and trace your source code as you normally would with any other program. Note: instead of using gdb, you might find more convenient to use gdb-tui (gdb text user interface), or use other debuggers like ddd.

Categories : Debugging

Automount samba folder on Mac
I followed https://discussions.apple.com/thread/3221944?start=15&tstart=0 The key is setting the mount point in your home directory is by following three steps. Add this line to the end of /etc/auto_master: /- auto_smb Created /etc/auto_smb with the following line: /Users/user/mount -fstype=smbfs,soft smb://domain;user:password@server/folder Run automount: automount -vc The troubleshooting points are: If you encounter "Too many users" you need to review your SMB path for syntax errors. Also be careful of incorrect username / passwords, or passwords with special symbols. e.g. @ would need to be replaced with %40.

Categories : Osx

authenticate against with Active Directory via samba
I recommend you this article http://technet.microsoft.com/en-us/magazine/2008.12.linux.aspx from Microsoft. The configure file seems OK.

Categories : Misc

samba shares seen in windows, but cannot connect
Add the following to your [global] section: guest account = nfsnobody map to guest = bad user And your public share could look something like: [Backups-Rhonda] path = /raid1/rhonda writable = yes guest ok = yes public = yes force user = root force group = root create mask = 666 directory mask = 666 security mask = 666 force create mode = 666 Make sure to restart the samba service.

Categories : Misc

Android - Mount a Samba share in code
Probably smbfs/cifs are currently not supported by your kernel. As Delyan said, ensure your kernel can mount these filesystem : $ cat /proc/filesystems nodev sysfs nodev rootfs nodev bdev nodev proc nodev cgroup nodev tmpfs nodev debugfs nodev sockfs nodev usbfs .... If they are not listed, you should try to do a modprobing (sometimes the module you want just have to be activated), get root access then : # modprobe <modulename(without.ko)> e.g. : # modprobe cifs If it doesn't work you will have to change or recompile your kernel (including appropriate modules).

Categories : Android

Apache/php cannot access remote cifs/samba share
have you tried //ip/foleder/ /mnt/name cifs username=user,password=passwd,nounix,noserverino,defaults,users,auto,gid=33,uid=33 0 0 change gid and uid to the apache user u can find it out like this: cat /etc/passwd | grep www-data

Categories : Apache

I'm trying to connect from windows to Samba Shared folder on linux using php
i found solution for connection using this code $sharename = '\\LinuxIPAddressShared_folder'; $username = 'username'; $password = 'password'; $letter = 'Z:'; if (!is_dir($letter . "/TMP")) { $WshNetwork = new COM("WScript.Network"); $WshNetwork->MapNetworkDrive($letter, $sharename, FALSE, $username, $password); } and is working perfect

Categories : PHP

Why would my samba connection fail after an upgrade to windows 2012?
Windows Server 2012 includes latest version of SMB protocol 3.0 and it full of really interesting updates and improvements (details and some relevant discussion here). As with any serious improvements there is a compromise in terms of legacy clients support. Probably there is no support for SMB 3.0 on your Samba client side or some backward compatibility should be enabled on Server 2012 side.

Categories : Java

Making a user in Samba - Debian 6 32bit - No commands working?
Solution: Setup Apt-get upgrade sudo apt-get install samba smbfs sudo mkdir –m 0777 /pathofdrive Editing the samba config sudo vi /etc/samba/smb.conf Copy this: # Global parameters [global] workgroup = HOME netbios name = SAMBA server string = Samba Server %v map to guest = Bad User log file = /var/log/samba/log.%m max log size = 50 socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 preferred master = No local master = No dns proxy = No security = User # Share [Data] path = /disk2/data valid users = joel read only = No create mask = 0777 directory mask = 0777 Adding a user: # useradd -c "Joel Nahrgang" joel # smbpasswd -a joel New SMB password: secret Reenter SMB password: secret Added user joel Restarting Samba:

Categories : Linux

How to access a shared location in solaris from windows machine using samba with java?
"Connection refused" means that host is not listening on that port. You need to ensure the samba service is running on that host. I would check you can mount the file system as a drive letter first.

Categories : Java

When clicking a file to create a jstree leaf, it create many leafs using jquery
You can use .one() $(this).one("click", function(event) { if($.trim($(this).attr("value")) == "fileButton") { var fileID = setID(); $("#treeFile").jstree("create", null, "last", {"attr" : "SpecialFile", "id" : "file_"+fileID}) } });

Categories : Jquery

I try to create a build in ant were it create a html report which will start my .class file
Try the following build.xml. Please keep it in mind the following change you need to do manually in this file Project name in very first line lib.dir address should be the one where all of your jars are kept physically. I suggest create a dir, put all the jars in this and give the address over here. the report directory I have changed and now it is under the project directory, parallel to src. If you need you can change it. Please note that I have changed my build.xml having many other features to the one you are comfortable. I have updated it very carefully, though very few changes may left by mistake that I suppose you can do. still if you found any problem, I would love to help you as far as I can. <project name="ProjectName" basedir="."> <property name="home.dir"

Categories : Java

Why will Qt not create a text file when running or debugging from inside Qt, but will create it when directly from the debug folder?
You probably used a relative path, and inside QtCreator the "current directory" from where the executable is ran is not necessarily the directory where the executable is. Try: qDebug() << QDir::currentPath(); It will tell you where you should expect your file to be written.

Categories : C++

Is it possible to create user account for only can create IPA file but cannot delete or touch anything else?
Yes, you can do that. If the user is only a member, he can't change anything. Only admins and agents can create provisioning profiles etc. To create users, you have to have a company account.

Categories : IOS

I want to create a source file that calls a function without having to create an object
Just put int mergesort(int *, int, int); in the header and then call mergesort(a,0,9); from your main.cpp and you will be fine. I suppose that you come from a true object oriented language (such as Java) background, where everything needs to be an object. In C++ a standalone function is perfectly fine. There is also no need for the public and static keywords, since those pertain to classes. I strongly recommend that you read a C or C++ book. Look here.

Categories : C++

Open txt file, create new txt file, save old text to new file
The line outfilename$.SaveAs =:"FileName"infilename.txt",False" looks quite wrong indeed. You coud try this instead to pop-up a dialog for saving file outfilename$ = Application.GetSaveAsFilename(infilename$, "Neutral Files (*.txt),*.txt", , "Save file", "SAVE") Update : The full code is Sub test() Dim outfilename as Variant Dim infilename as Variant Dim msg As Variant infilename = Application.GetOpenFilename("Neutral Files (*.txt),*.txt", , "Open Neutral File", "OPEN", False) If infilename = "False" Then msg = MsgBox("No input file selected. Press OK to retry or cancel to quit", vbOKCancel) If msg = vbOK Then Do While msg <> vbCancel 'loop until user presses cancel infilename = Application.GetOpenFilename("Neutral Files (*.r01),*.r01", , "Open

Categories : Vba

check file size while writing file and create new file
I suggest you create a separate class whose only job it is to create files (in sequence), write data to the file, keep an eye on the size, and close / open files as needed. This will make your code more organized - you will be able to see your mistakes more clearly. The class would have the following methods: setMax(maxVal) - set the maximum file size (default 400k) setRoot(rootPath) - folder where files will be created setName(rootName) - "format string" used to generate file names (e.g. "myFile%03d.dat") writeData(dataSize, dataBlock) - write data. If no file open, open it. If file too big, split it. closeFile() - flush buffers, close the last file.

Categories : Java

File operation to copy one .mp3 file to create another same file
getc() returns either an int, not a char. It needs to return int because it returns either the next byte read from the stream as a value between 0 and 255, or the value EOF, which is typically -1. Since there are 257 possible outputs, you need to be able to distinguish between the byte 255 and the sentinel EOF, but your code is conflating the two. Hence, once you hit the first byte with value 255, it erroneously cuts the file off short. If you change c to be int instead of char, it should work correctly.

Categories : C

Batch file to create multiple variables from single lines in a text file
This should work: @echo off setlocal EnableDelayedExpansion set "Count=1" for /f "tokens=1,2,3,4,5,6,7 delims==: " %%A in (C:File.txt) do ( set "%%A[!Count!]=%%C" set "%%D[!Count!]=%%E" set "%%F[!Count!]=%%G" set /a "Count+=1" ) :: Call other batch script here. endlocal Example Output: COMPUTER[1]=PC COMPUTER[2]=PC2 ADDRESS[1]=154.100.1.1 ADDRESS[2]=100.100.1.1 MASK[1]=255.255.254.0 MASK[2]=255.255.254.0

Categories : Batch File

Python 3 code to read CSV file, manipulate then create new file....works, but looking for improvements
You can greatly simplify your code using more of numpy capabilities. A = np.loadtxt('stack.txt',skiprows=2,delimiter=',',dtype=str) keep_headers=np.loadtxt('keepheader.csv',delimiter=',',dtype=str) headers = A[0,:] cols_to_keep = np.in1d( headers, keep_headers ) B = np.float_(A[1:,cols_to_keep]) np.savetxt('cmap.csv',B,fmt='%.3f',delimiter=",")

Categories : Csv

Executing a batch file to create a test file with xp_cmdshell - differentt results
If you test the commands directly at a command prompt, they work. The cd statement produces a text file containing the name of the current directory; the type statement produces a zero-byte file, but it does indeed produce a file. Most likely, xp_cmdshell is executing in a folder where the account it's running under has no write privileges, and you're not specifying another location for the file to be written. (The echo statement that works specifies a folder location for the text file, while your other two don't.) Change your batch file to: cd > C:development est est1.txt or type NUL > C:development est est1.txt If the echo statement works there when run via xp_cmdshell, you know it's writable by the NTAuthority account.

Categories : Sql Server

Find txt files, create an empty file for each of them, then delete the original file
If you're not using Java7, here's a solution. Otherwise take a look @Heuster's comment. File dir = new File("/directoryToFile"); File [] files = dir.listFiles(new FilenameFilter() { @Override public boolean accept(File dir, String name) { return name.equals("fileName.txt"); } }); if(files != null && files.length > 0){ File f = new File(files[0].getAbsolutePath()); files[0].delete(); f.createNewFile(); }

Categories : Java

How can i create dxdiag.txt file automatic ? ( DirectX information text file )
This is rather a Windows batch script question, to get the date, you can use the following command echo %date% This generate the output as Wed 07/24/2013, to convert the date to the format you want, you can use %date:~i,n% where i is the start index of the sub string and n is number of characters to get. for example %date:~10,4% will get 2013(4 digits for year) full code echo off set today=%date:~7,2%-%date:~4,2%-%date:~10,4% echo %today% this will get the date string of today, the output is 24-07-2013, you can then insert this string to your script.

Categories : C#

Windows Batch File: Look for directory, if not exist, create, then move file to it
You can conditionally create the folder with: if not exist moviesshowname mkdir moviesshowname To move a file into it: move ShowName.Episode.Title.mkv moviesshowname To get more information about these commands, open a command prompt and type: help if and help move

Categories : Batch File

shell script to create backup file when creating new file in particular directory
Can you explain why you want to do? Tools like VIM can create a backup copy of a file you're working on automatically. Other tools like Dropbox (which works on Linux, Windows, and Mac) can version files, so it backs up all the copies of the file for the last 30 days. You could do something by creating aliases to the tools you use for creating these file. You edit a file with the tools you tend to use, and the alias could create a copy before invoking a tool. Otherwise, your choice is to use crontab to occasionally make backups. Addendum let me explain suppose i have directory /home/pavan now i create the file myfile.txt in that directory , immediately now i should automatically generate myfileCopy.txt file in the same folder paven There's no easy user tool that could do that.

Categories : Linux

Warning: File upload error - unable to create a temporary file in Unknown on line 0
use double quotes in ../inventory_images/$newname. change this line move_uploaded_file($_FILES['fileField']['tmp_name'],'../inventory_images/$newname'); AS move_uploaded_file($_FILES['fileField']['tmp_name'],'../inventory_images/'.$newname); NOTE: in php with single quotes $newname will be display as string. for displaying value of a variable use double quotes

Categories : PHP

linux Bash - read contents of file , store them in a variable and create network config file
I tried yesterday and I am very close to the solution. Researching the internet , I made a perl script and was able to create multiple interface by extracting data from csv file. But there is small issue I see and not able to figure out why an extra character is coming in the file. Following is the code: #!/usr/bin/perl use strict; use warnings; sub main { # Note: this could be a full file path my $filename = "file1.csv"; open(INPUT, $filename) or die "Cannot open $filename"; # Read the header line. #my $line = <INPUT>; my $line; # Read the lines one by one. while($line = <INPUT>) { chomp($line); # Display the header, just to check things are working.

Categories : Linux

Create output file names based on input file name with autonumbers shell script linux
VAR="INPUTFILENAME" # One solution this does not use the VAR: touch INPUTFILENAME{1,2,3,4,5,6,7,8,9,10} # Another for i in `seq 1 20` ; do touch "${VAR}${i}" done And there are several other ways.

Categories : Linux

Bash shell read names of files from folder and create an output file for each input file with the same name:
The underscore is a valid character in variable names. Do: ./"$f" > "${f}_july_15.txt" Your code was trying to use a variable named f_july_15. You need to use braces to delimit the variable name when it's followed by a character that can be part of a variable name.

Categories : Bash

Java: Create a KML File and insert elements in existing file
When modifying XML files it is best accomplished using a library of some sort. I maintain the XML-manipulation library called JDOM which is designed to make this sort of manipulation as easy as it can. Other options are using the DOM library (which is already built in to the Java runtime which makes it much easier to integrate in to your program), and SAX (which, in this case, I would not recommend, even though it may be faster). Other external libraries (like JDOM) exist which would also help, like XOM, dom4j, etc. This stackoverflow answer seems relevant: Best XML parser for Java In JDOM, your code would look something like: Document doc = null; Namespace kmlns = new Namespace("http://www.opengis.net/kml/2.2"); Element position = new Element("Position", kmlns); position

Categories : Java

Simple PowerShell Script to loop through 1 CSV file to create a new CSV file from another
Borrowing Shay's awesome CSV field enumeration code: $offices = Import-Csv 'C:path ooffices.csv' Import-Csv 'C:path ousers.csv' | % { foreach ($prop in $_.PSObject.Properties) { $offices | select @{n=$prop.Name;e={$prop.Value}}, OFFICES } } | Export-Csv 'C:path ocombined.csv' -NoTypeInformation

Categories : Powershell

Node-Webkit: How to create a file in the local file system?
It sounds like you might be trying to use the web filesystem API. That might be a reasonable solution, it would allow you to run your app as a regular webpage, however the web filesystem API is sandboxed. node-webkit offers "Complete support for Node.js APIs," which I think means you can use the node.js file system API to write anywhere on the file system. Pretty cool. So something like this should work: var fs = require('fs'); fs.writeFile("path/to/anywhere/test.txt", "Hi mom!", function(err) { if(err) { alert("error"); } }); Also, node-webkit web-workers do not support require I hear. So you'll need to do your filesystem stuff in your main thread.

Categories : Javascript

How to link main function with header file and create it's dll file?
I'll say more about the DLL further down, but for a start, here is the layout of the source files you'll need to do that. You'll need three files: main.c kmp.h kmp.c. Code structure: File main.c #include <stdio.h> #include "kmp.h" // this will make the kmp() function known to main() int main(int argc, const char *argv[]) { char target[200]; ... same code as you aready have } File kmp.h // prototype to make kmp() function known to external programs (via #include) extern int kmp(char *target, int tsize, char *pattern, int psize); File kmp.c #include <stdio.h> #include <stdlib.h> #include <string.h> // declare kmp prototype as DLL-export _declspec(dllexport) int kmp(char *target, int tsize, char *pattern, int psize); // prototype for inte

Categories : C

Windows batch file to create csv list of file and dates
Something like this might work: @echo off setlocal EnableDelayedExpansion ( echo "Name","Modification Time","Creation Time" for %%f in (*) do ( set "name=%%~nxf" if not "!name!"=="%~nx0" ( set "mtime=%%~tf" for /f "tokens=1-3" %%d in ( 'dir /t:c "!name!" ^| find /i "!name!"' ) do set "ctime=%%~d %%~e %%~f" echo "!name!","!mtime!","!ctime!" ) ) ) > output.csv

Categories : Windows

cannot create log file when running batch file in task scheduler
Replace cd E:www80curl with cd /d E:www80curl (or just add the line E:). By default, the cd command will change the current directory for the named drive yet not the current drive.

Categories : PHP

perl script to read xml file and create a property file
Try XML::Simple my all time favorite "XML parser" for simple XML processing. It loads your file into a ready to use perl hash/array of hash/array of ... :- use XML::Simple; use Data::Dumper; my $ref = XMLin('test.xml'); # load the file print STDERR Dumper($ref); # see how it looks foreach my $k (keys %{$ref->{entry}}) # output to conf { $v = $ref->{entry}->{$k}->{content}; print "$k=$v "; } Works nicely :- % perl test.pl HOST= localhost LOCATION= C:Rel-LOCATION TYPE= Rel I have left the trimming etc for you :)

Categories : Perl

Create hyperlink using XSLT which open xml file on the file system
I'm not sure what <a href="<H3>...</H3>"></a> is supposed to mean, so I assume you want something like this: <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes"/> <xsl:template match="Document"> <html> <head/> <body> <xsl:apply-templates select="racine" /> </body> </html> </xsl:template> <xsl:template match="racine"> <h3> <a href="{encode-for-uri(label)}"><xsl:value-of select="label" /></a> </h3> </xsl:template> </xsl:stylsheet> Note the use of template matching (<xsl:apply-templates> / <xsl:template>) over <xsl:f

Categories : Xml



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.